Class: XTwitterScraper::Resources::Compose

Inherits:
Object
  • Object
show all
Defined in:
lib/x_twitter_scraper/resources/compose.rb

Overview

Tweet composition, drafts, writing styles & radar

Instance Method Summary collapse

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.

Parameters:



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

Parameters:

Returns:

See Also:



38
39
40
41
42
43
44
45
46
47
# File 'lib/x_twitter_scraper/resources/compose.rb', line 38

def create(params)
  parsed, options = XTwitterScraper::ComposeCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "compose",
    body: parsed,
    model: XTwitterScraper::Models::ComposeCreateResponse,
    options: options
  )
end