Class: XTwitterScraper::Resources::Compose
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::Compose
- Defined in:
- lib/x_twitter_scraper/resources/compose.rb
Overview
Tweet composition, drafts, writing styles & radar
Instance Method Summary collapse
-
#create(step:, additional_context: nil, call_to_action: nil, draft: nil, goal: nil, has_link: nil, has_media: nil, media_type: nil, style_username: nil, tone: nil, topic: nil, request_options: {}) ⇒ XTwitterScraper::Models::ComposeCreateResponse
Compose, refine, or score a tweet.
-
#initialize(client:) ⇒ Compose
constructor
private
A new instance of Compose.
Constructor Details
#initialize(client:) ⇒ Compose
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 Compose.
52 53 54 |
# File 'lib/x_twitter_scraper/resources/compose.rb', line 52 def initialize(client:) @client = client end |
Instance Method Details
#create(step:, additional_context: nil, call_to_action: nil, draft: nil, goal: nil, has_link: nil, has_media: nil, media_type: nil, style_username: nil, tone: nil, topic: nil, request_options: {}) ⇒ XTwitterScraper::Models::ComposeCreateResponse
Compose, refine, or score a tweet
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/x_twitter_scraper/resources/compose.rb', line 38 def create(params) parsed, = XTwitterScraper::ComposeCreateParams.dump_request(params) @client.request( method: :post, path: "compose", body: parsed, model: XTwitterScraper::Models::ComposeCreateResponse, options: ) end |