From 38203b745ae1903ba0804ed5532b78d255bea635 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 5 Aug 2018 11:14:39 -0400 Subject: 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. --- src/request.h | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/request.h (limited to 'src/request.h') diff --git a/src/request.h b/src/request.h new file mode 100644 index 0000000..1672d71 --- /dev/null +++ b/src/request.h @@ -0,0 +1,73 @@ +#ifndef REQUEST_H_9D3C30E2 +#define REQUEST_H_9D3C30E2 + +#include +#include +#include +#include +#include "auth.h" + +namespace twitter { + + class request + { + public: + + explicit request(std::string url); + + std::string perform(); + + private: + + std::ostringstream output_; + curl::curl_ios ios_; + + protected: + + curl::curl_easy conn_; + }; + + class get : public request + { + public: + + get( + const auth& tauth, + std::string url); + + private: + + curl::curl_header headers_; + }; + + class post : public request + { + public: + + post( + const auth& tauth, + std::string url, + std::string datastr); + + private: + + curl::curl_header headers_; + }; + + class multipost : public request + { + public: + + multipost( + const auth& tauth, + std::string url, + const curl_httppost* fields); + + private: + + curl::curl_header headers_; + }; + +} + +#endif /* end of include guard: REQUEST_H_9D3C30E2 */ -- cgit 1.4.1