From 9b3b0c356af994c642e7c19af671471125fbccd2 Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 16 Oct 2017 23:56:35 -0700 Subject: prelim conversation viewing --- src/commands/view.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') 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." + * */ +} -- cgit v1.1