From 7e85b35d7d1714e3f85434b891a1050ad584e337 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 13 Apr 2016 11:24:24 -0400 Subject: Added ability to upload media and tweet it Images (static and animated) and videos have been tested. Currently all media uploads occur in one large chunk; support to break down chunks will be added later. --- src/client.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/client.h') 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 @@ #ifndef TWITTER_H_ABFF6A12 #define TWITTER_H_ABFF6A12 -#include "twitter.h" +#include "codes.h" +#include "tweet.h" +#include "auth.h" +#include +#include +#include namespace OAuth { class Consumer; @@ -16,12 +21,18 @@ namespace twitter { client(const auth& _auth); ~client(); - response updateStatus(std::string msg, tweet& result); + response updateStatus(std::string msg, tweet& result, std::list media_ids = {}); + response uploadMedia(std::string media_type, const char* data, long data_length, long& media_id); private: OAuth::Consumer* _oauth_consumer; OAuth::Token* _oauth_token; OAuth::Client* _oauth_client; + + bool performGet(std::string url, long& response_code, json& result); + bool performPost(std::string url, std::string dataStr, long& response_code, json& result); + bool performMultiPost(std::string url, const curl_httppost* fields, long& response_code, json& result); + response codeForError(int httpcode, json errors) const; }; }; -- cgit 1.4.1