diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-10-17 00:11:22 -0700 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-10-17 00:11:56 -0700 |
commit | ebe62b5ad92b60549deffd2d729c43134f93d96c (patch) | |
tree | 9f5975587d77e96d00f6c89260e8976f6c5e4215 /src/tw | |
parent | a2a228ffb67d46de7d70790d2e6cdcefc366c2c6 (diff) |
check followers on startup too
Diffstat (limited to 'src/tw')
-rw-r--r-- | src/tw/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tw/mod.rs b/src/tw/mod.rs index 710bf59..49b7add 100644 --- a/src/tw/mod.rs +++ b/src/tw/mod.rs @@ -383,6 +383,10 @@ impl TwitterCache { pub fn get_settings(&self, queryer: &mut ::Queryer) -> Option<serde_json::Value> { queryer.do_api_get(::ACCOUNT_SETTINGS_URL) } + + pub fn get_followers(&self, queryer: &mut ::Queryer) -> Option<serde_json::Value> { + queryer.do_api_get(::GET_FOLLOWER_IDS_URL) + } } fn handle_twitter_event( @@ -443,6 +447,9 @@ fn handle_twitter_welcome( } else { println!("Unable to make API call to figure out who you are..."); } + let followers = tweeter.get_followers(queryer).unwrap(); + let id_arr: Vec<String> = followers["ids"].as_array().unwrap().iter().map(|x| x.as_str().unwrap().to_owned()).collect(); + tweeter.set_followers(id_arr); } pub fn handle_message( |