Class: XTwitterScraper::Resources::X::Tweets::Like
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::X::Tweets::Like
- Defined in:
- lib/x_twitter_scraper/resources/x/tweets/like.rb
Overview
X write actions (tweets, likes, follows, DMs)
Instance Method Summary collapse
-
#create(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::LikeCreateResponse
Like tweet.
-
#delete(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::LikeDeleteResponse
Unlike tweet.
-
#initialize(client:) ⇒ Like
constructor
private
A new instance of Like.
Constructor Details
#initialize(client:) ⇒ Like
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Like.
60 61 62 |
# File 'lib/x_twitter_scraper/resources/x/tweets/like.rb', line 60 def initialize(client:) @client = client end |
Instance Method Details
#create(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::LikeCreateResponse
Like tweet
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/x_twitter_scraper/resources/x/tweets/like.rb', line 22 def create(id, params) parsed, = XTwitterScraper::X::Tweets::LikeCreateParams.dump_request(params) @client.request( method: :post, path: ["x/tweets/%1$s/like", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::LikeCreateResponse, options: ) end |
#delete(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::LikeDeleteResponse
Unlike tweet
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/x_twitter_scraper/resources/x/tweets/like.rb', line 46 def delete(id, params) parsed, = XTwitterScraper::X::Tweets::LikeDeleteParams.dump_request(params) @client.request( method: :delete, path: ["x/tweets/%1$s/like", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse, options: ) end |