about summary refs log tree commit diff stats
path: root/src/auth.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-08-05 11:14:39 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-08-05 11:14:39 -0400
commit38203b745ae1903ba0804ed5532b78d255bea635 (patch)
tree52f57ce85e65361c534c461abc82fb1ed9768d49 /src/auth.h
parent7c44fd17bb6be54a2ea4b60761e91053ca988977 (diff)
downloadlibtwittercpp-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/auth.h')
-rw-r--r--src/auth.h44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/auth.h b/src/auth.h index ef07e81..30c178c 100644 --- a/src/auth.h +++ b/src/auth.h
@@ -2,28 +2,36 @@
2#define AUTH_H_48EF85FD 2#define AUTH_H_48EF85FD
3 3
4#include <string> 4#include <string>
5#include "../vendor/liboauthcpp/include/liboauthcpp/liboauthcpp.h"
5 6
6namespace twitter { 7namespace twitter {
7 8
8 class auth { 9 class auth {
9 public: 10 public:
10 void setConsumerKey(std::string _arg); 11
11 void setConsumerSecret(std::string _arg); 12 auth(
12 void setAccessKey(std::string _arg); 13 std::string consumerKey,
13 void setAccessSecret(std::string _arg); 14 std::string consumerSecret,
14 15 std::string accessKey,
15 std::string getConsumerKey() const; 16 std::string accessSecret) :
16 std::string getConsumerSecret() const; 17 consumer_(std::move(consumerKey), std::move(consumerSecret)),
17 std::string getAccessKey() const; 18 token_(std::move(accessKey), std::move(accessSecret)),
18 std::string getAccessSecret() const; 19 client_(&consumer_, &token_)
19 20 {
20 private: 21 }
21 std::string _consumer_key; 22
22 std::string _consumer_secret; 23 const OAuth::Client& getClient() const
23 std::string _access_key; 24 {
24 std::string _access_secret; 25 return client_;
26 }
27
28 private:
29
30 OAuth::Consumer consumer_;
31 OAuth::Token token_;
32 OAuth::Client client_;
25 }; 33 };
26 34
27}; 35};
28 36
29#endif /* end of include guard: AUTH_H_48EF85FD */ 37#endif /* end of include guard: AUTH_H_48EF85FD */