diff options
Diffstat (limited to 'src/client.h')
-rw-r--r-- | src/client.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client.h b/src/client.h index 1ab5c70..3a133e4 100644 --- a/src/client.h +++ b/src/client.h | |||
@@ -1,7 +1,12 @@ | |||
1 | #ifndef TWITTER_H_ABFF6A12 | 1 | #ifndef TWITTER_H_ABFF6A12 |
2 | #define TWITTER_H_ABFF6A12 | 2 | #define TWITTER_H_ABFF6A12 |
3 | 3 | ||
4 | #include "twitter.h" | 4 | #include "codes.h" |
5 | #include "tweet.h" | ||
6 | #include "auth.h" | ||
7 | #include <list> | ||
8 | #include <curl_easy.h> | ||
9 | #include <curl_header.h> | ||
5 | 10 | ||
6 | namespace OAuth { | 11 | namespace OAuth { |
7 | class Consumer; | 12 | class Consumer; |
@@ -16,12 +21,18 @@ namespace twitter { | |||
16 | client(const auth& _auth); | 21 | client(const auth& _auth); |
17 | ~client(); | 22 | ~client(); |
18 | 23 | ||
19 | response updateStatus(std::string msg, tweet& result); | 24 | response updateStatus(std::string msg, tweet& result, std::list<long> media_ids = {}); |
25 | response uploadMedia(std::string media_type, const char* data, long data_length, long& media_id); | ||
20 | 26 | ||
21 | private: | 27 | private: |
22 | OAuth::Consumer* _oauth_consumer; | 28 | OAuth::Consumer* _oauth_consumer; |
23 | OAuth::Token* _oauth_token; | 29 | OAuth::Token* _oauth_token; |
24 | OAuth::Client* _oauth_client; | 30 | OAuth::Client* _oauth_client; |
31 | |||
32 | bool performGet(std::string url, long& response_code, json& result); | ||
33 | bool performPost(std::string url, std::string dataStr, long& response_code, json& result); | ||
34 | bool performMultiPost(std::string url, const curl_httppost* fields, long& response_code, json& result); | ||
35 | response codeForError(int httpcode, json errors) const; | ||
25 | }; | 36 | }; |
26 | 37 | ||
27 | }; | 38 | }; |