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