diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-14 02:16:27 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-14 02:16:27 -0500 |
commit | 4cf78a6371b4df02242bb055b8e15d9c9223dbb0 (patch) | |
tree | e7972929a0316233f924dbc529a88157617a2354 /snitch.cpp | |
parent | 6ce9e71bd0f188bcb5a66ecbad8af348b3e348af (diff) | |
download | snitch-4cf78a6371b4df02242bb055b8e15d9c9223dbb0.tar.gz snitch-4cf78a6371b4df02242bb055b8e15d9c9223dbb0.tar.bz2 snitch-4cf78a6371b4df02242bb055b8e15d9c9223dbb0.zip |
Fixed bot ignoring non-reply tweets
Diffstat (limited to 'snitch.cpp')
-rw-r--r-- | snitch.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/snitch.cpp b/snitch.cpp index 3758dc0..1155da7 100644 --- a/snitch.cpp +++ b/snitch.cpp | |||
@@ -73,7 +73,7 @@ int main(int argc, char** argv) | |||
73 | try | 73 | try |
74 | { | 74 | { |
75 | long media_id = client.uploadMedia("image/jpeg", (const char*) img_buf, img_len); | 75 | long media_id = client.uploadMedia("image/jpeg", (const char*) img_buf, img_len); |
76 | client.replyToTweet(n.getTweet().generateReplyPrefill(), n.getTweet().getID(), {media_id}); | 76 | client.replyToTweet(n.getTweet().generateReplyPrefill(client.getUser()), n.getTweet().getID(), {media_id}); |
77 | } catch (const twitter::twitter_error& e) | 77 | } catch (const twitter::twitter_error& e) |
78 | { | 78 | { |
79 | std::cout << "Twitter error: " << e.what() << std::endl; | 79 | std::cout << "Twitter error: " << e.what() << std::endl; |
@@ -87,7 +87,7 @@ int main(int argc, char** argv) | |||
87 | { | 87 | { |
88 | try | 88 | try |
89 | { | 89 | { |
90 | n.getUser().follow(); | 90 | client.follow(n.getUser()); |
91 | } catch (const twitter::twitter_error& e) | 91 | } catch (const twitter::twitter_error& e) |
92 | { | 92 | { |
93 | std::cout << "Twitter error while following @" << n.getUser().getScreenName() << ": " << e.what() << std::endl; | 93 | std::cout << "Twitter error while following @" << n.getUser().getScreenName() << ": " << e.what() << std::endl; |
@@ -101,8 +101,8 @@ int main(int argc, char** argv) | |||
101 | 101 | ||
102 | try | 102 | try |
103 | { | 103 | { |
104 | std::set<twitter::user_id> friends = client.getUser().getFriends(); | 104 | std::set<twitter::user_id> friends = client.getFriends(); |
105 | std::set<twitter::user_id> followers = client.getUser().getFollowers(); | 105 | std::set<twitter::user_id> followers = client.getFollowers(); |
106 | 106 | ||
107 | std::list<twitter::user_id> old_friends, new_followers; | 107 | std::list<twitter::user_id> old_friends, new_followers; |
108 | std::set_difference(std::begin(friends), std::end(friends), std::begin(followers), std::end(followers), std::back_inserter(old_friends)); | 108 | std::set_difference(std::begin(friends), std::end(friends), std::begin(followers), std::end(followers), std::back_inserter(old_friends)); |