RTを叩くやつ(#65)
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
#include <cocoatweet/api/status/retweet.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
namespace CocoaTweet::API::Statuses {
|
||||||
|
Retweet::Retweet(){}
|
||||||
|
|
||||||
|
void Retweet::id(const std::string& _id){
|
||||||
|
contentType_ = "application/x-www-form-urlencoded";
|
||||||
|
url_ = "https://api.twitter.com/1.1/statuses/retweet/" + _id + ".json";
|
||||||
|
}
|
||||||
|
|
||||||
|
CocoaTweet::API::Model::Tweet Retweet::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth){
|
||||||
|
CocoaTweet::API::Model::Tweet tweet;
|
||||||
|
HttpPost::process(_oauth,
|
||||||
|
[&tweet](const unsigned int _responseCode, const std::string& _rcv) {
|
||||||
|
tweet = CocoaTweet::API::Model::Tweet(_responseCode, _rcv);
|
||||||
|
});
|
||||||
|
|
||||||
|
return tweet;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef COCOATWEET_API_STATUS_RETWEET_H_
|
||||||
|
#define COCOATWEET_API_STATUS_RETWEET_H_
|
||||||
|
|
||||||
|
#include <cocoatweet/api/interface/httpPost.h>
|
||||||
|
#include <cocoatweet/api/model/tweet.h>
|
||||||
|
|
||||||
|
namespace CocoaTweet::API::Statuses {
|
||||||
|
class Retweet : public CocoaTweet::API::Interface::HttpPost{
|
||||||
|
public:
|
||||||
|
Retweet();
|
||||||
|
|
||||||
|
void id(const std::string& _id);
|
||||||
|
|
||||||
|
CocoaTweet::API::Model::Tweet process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user