diff options
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)); |