statuses/unretweet/:idを叩くやつ

This commit is contained in:
keita
2021-03-20 10:26:31 +09:00
parent 576a4a5ea3
commit 81d248151a
2 changed files with 39 additions and 0 deletions
+21
View File
@@ -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
+18
View File
@@ -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