diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-10-16 23:56:35 -0700 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-10-17 00:11:56 -0700 |
commit | a2a228ffb67d46de7d70790d2e6cdcefc366c2c6 (patch) | |
tree | f97bf6f0589918025341c18105d20635361c87ea | |
parent | f3f938d2aa9cd1cc077fec386e5c0751ade6839c (diff) |
prelim conversation viewing
-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." + * */ +} |