From 3c042afe7872d5488fd91c2b1a42036953f604eb Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Thu, 30 Nov 2017 03:07:05 -0800 Subject: remove unneeded params, adjust id display tweets are now recorded with the date they are recieved at dated id lookup is now supported tweet ids, where displayed, are displayed in a convenient form: if the tweet was recieved today, show the today id if the tweet was recieved on a different day, show the bare id many instances where display_info was passed for logging information, the parameter has become unnecessary, so it's gone now --- src/tw/tweet.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/tw/tweet.rs') diff --git a/src/tw/tweet.rs b/src/tw/tweet.rs index 38b838d..2ca32c3 100644 --- a/src/tw/tweet.rs +++ b/src/tw/tweet.rs @@ -1,5 +1,7 @@ extern crate serde_json; +use chrono::prelude::*; + use std::collections::HashMap; use tw::user::User; @@ -10,6 +12,8 @@ pub struct Tweet { pub author_id: String, pub text: String, pub created_at: String, // lol + #[serde(default = "Utc::now")] + pub recieved_at: DateTime, #[serde(skip_serializing_if="HashMap::is_empty")] #[serde(default = "HashMap::default")] pub urls: HashMap, @@ -84,6 +88,7 @@ impl Tweet { author_id: author_id.to_owned(), text: text, created_at: created_at.to_owned(), + recieved_at: Utc::now(), urls: url_map, quoted_tweet_id: json_map.get("quoted_status_id_str") .and_then(|x| x.as_str()) -- cgit v1.1