diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-08-05 11:14:39 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-08-05 11:14:39 -0400 |
commit | 38203b745ae1903ba0804ed5532b78d255bea635 (patch) | |
tree | 52f57ce85e65361c534c461abc82fb1ed9768d49 /src/timeline.h | |
parent | 7c44fd17bb6be54a2ea4b60761e91053ca988977 (diff) | |
download | libtwittercpp-38203b745ae1903ba0804ed5532b78d255bea635.tar.gz libtwittercpp-38203b745ae1903ba0804ed5532b78d255bea635.tar.bz2 libtwittercpp-38203b745ae1903ba0804ed5532b78d255bea635.zip |
Added timeline polling
Because the streaming API will sunset on August 16th, it is essential to implement timeline polling so that the library can still be used to access tweets. This commit breaks the current API even for clients still using the streaming API because the OAuth connection data was pulled from twitter::client into twitter::auth. Other than that, almost everything works the same, and if a client wants to update their libtwitter++ within the next week and a half, they are free to.
Diffstat (limited to 'src/timeline.h')
-rw-r--r-- | src/timeline.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/timeline.h b/src/timeline.h new file mode 100644 index 0000000..60ce78d --- /dev/null +++ b/src/timeline.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef TIMELINE_H_D359681C | ||
2 | #define TIMELINE_H_D359681C | ||
3 | |||
4 | #include <functional> | ||
5 | #include <list> | ||
6 | #include <string> | ||
7 | #include "auth.h" | ||
8 | #include "tweet.h" | ||
9 | |||
10 | namespace twitter { | ||
11 | |||
12 | class timeline { | ||
13 | public: | ||
14 | |||
15 | timeline( | ||
16 | const auth& tauth, | ||
17 | std::string url); | ||
18 | |||
19 | std::list<tweet> poll(); | ||
20 | |||
21 | private: | ||
22 | |||
23 | const auth& auth_; | ||
24 | std::string url_; | ||
25 | bool hasSince_ = false; | ||
26 | tweet_id sinceId_; | ||
27 | }; | ||
28 | |||
29 | } | ||
30 | |||
31 | #endif /* end of include guard: TIMELINE_H_D359681C */ | ||