diff options
author | iximeow <me@iximeow.net> | 2017-10-16 23:56:35 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2017-10-17 00:11:56 -0700 |
commit | 9b3b0c356af994c642e7c19af671471125fbccd2 (patch) | |
tree | f97bf6f0589918025341c18105d20635361c87ea /src | |
parent | 280ae97621e85599a9dd401c3174732b45ad643f (diff) |
prelim conversation viewing
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/view.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/commands/view.rs b/src/commands/view.rs index cc098e7..b9cbf96 100644 --- a/src/commands/view.rs +++ b/src/commands/view.rs @@ -45,3 +45,27 @@ fn view_tr_inner(id: u64, mut tweeter: &mut tw::TwitterCache, queryer: &mut Quer display::render_twete(&twete.id, tweeter); // println!("link: https://twitter.com/i/web/status/{}", twete.id); } + +pub static VIEW_THREAD_FORWARD: Command = Command { + keyword: "viewthread+", + params: 1, + exec: view_tr_forward +}; + +fn view_tr_forward(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer) { + // first see if we have a thread for the tweet named + // if we do not, we'll have to mimic a request like + // curl 'https://twitter.com/jojonila/status/914383908090691584' \ + // -H 'accept-encoding: gzip, deflate, br' \ + // -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 \ + // (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36' \ + // -H 'x-overlay-request: true' + /* + * above results in a response: + * { + * "init_data": { ... }, + * "title": "tweet, but for page title", + * .. + * "page": "HTML THAT'S JUST DROPPED IN AS A MODAL." + * */ +} |