diff options
-rw-r--r-- | ebooks.cpp | 12 | ||||
m--------- | vendor/libtwittercpp | 0 |
2 files changed, 10 insertions, 2 deletions
diff --git a/ebooks.cpp b/ebooks.cpp index c183923..dd9c7bd 100644 --- a/ebooks.cpp +++ b/ebooks.cpp | |||
@@ -77,10 +77,18 @@ int main(int argc, char** args) | |||
77 | 77 | ||
78 | std::mutex stats_mutex; | 78 | std::mutex stats_mutex; |
79 | 79 | ||
80 | twitter::user me; | ||
81 | auto resp = client.getUser(me); | ||
82 | if (resp != twitter::response::ok) | ||
83 | { | ||
84 | std::cout << "Could not get current Twitter user" << std::endl; | ||
85 | return -1; | ||
86 | } | ||
87 | |||
80 | client.setUserStreamNotifyCallback([&] (twitter::notification n) { | 88 | client.setUserStreamNotifyCallback([&] (twitter::notification n) { |
81 | if (n.getType() == twitter::notification::type::tweet) | 89 | if (n.getType() == twitter::notification::type::tweet) |
82 | { | 90 | { |
83 | if ((!n.getTweet().isRetweet()) && (n.getTweet().getAuthor() != client.getUser())) | 91 | if ((!n.getTweet().isRetweet()) && (n.getTweet().getAuthor() != me)) |
84 | { | 92 | { |
85 | std::string original = n.getTweet().getText(); | 93 | std::string original = n.getTweet().getText(); |
86 | std::string canonical; | 94 | std::string canonical; |
@@ -122,7 +130,7 @@ int main(int argc, char** args) | |||
122 | doc.resize(140); | 130 | doc.resize(140); |
123 | 131 | ||
124 | twitter::tweet tw; | 132 | twitter::tweet tw; |
125 | twitter::response resp = client.updateStatus(doc, tw); | 133 | resp = client.updateStatus(doc, tw); |
126 | if (resp != twitter::response::ok) | 134 | if (resp != twitter::response::ok) |
127 | { | 135 | { |
128 | std::cout << "Twitter error while tweeting: " << resp << std::endl; | 136 | std::cout << "Twitter error while tweeting: " << resp << std::endl; |
diff --git a/vendor/libtwittercpp b/vendor/libtwittercpp | |||
Subproject cec9786bc11c897a00cf7ab8baafb142a709ba2 | Subproject 442f1ee071152be04c4184473ddfee5040795b7 | ||