Class: XTwitterScraper::Models::X::TweetSearchParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/x_twitter_scraper/models/x/tweet_search_params.rb

Overview

Defined Under Namespace

Modules: QueryType

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(q:, cursor: nil, limit: nil, query_type: nil, since_time: nil, until_time: nil, request_options: {}) ⇒ Object

Parameters:

  • q (String)

    Search query (keywords,

  • cursor (String) (defaults to: nil)

    Pagination cursor from previous response

  • limit (Integer) (defaults to: nil)

    Max tweets to return (server paginates internally). Omit for single page (~20).

  • query_type (Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType) (defaults to: nil)

    Sort order — Latest (chronological) or Top (engagement-ranked)

  • since_time (String) (defaults to: nil)

    ISO 8601 timestamp — only return tweets after this time

  • until_time (String) (defaults to: nil)

    ISO 8601 timestamp — only return tweets before this time

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/x_twitter_scraper/models/x/tweet_search_params.rb', line 47

Instance Attribute Details

#cursorString?

Pagination cursor from previous response

Returns:

  • (String, nil)


21
# File 'lib/x_twitter_scraper/models/x/tweet_search_params.rb', line 21

optional :cursor, String

#limitInteger?

Max tweets to return (server paginates internally). Omit for single page (~20).

Returns:

  • (Integer, nil)


27
# File 'lib/x_twitter_scraper/models/x/tweet_search_params.rb', line 27

optional :limit, Integer

#qString

Search query (keywords,

Returns:

  • (String)


15
# File 'lib/x_twitter_scraper/models/x/tweet_search_params.rb', line 15

required :q, String

#query_typeSymbol, ...

Sort order — Latest (chronological) or Top (engagement-ranked)



33
# File 'lib/x_twitter_scraper/models/x/tweet_search_params.rb', line 33

optional :query_type, enum: -> { XTwitterScraper::X::TweetSearchParams::QueryType }

#since_timeString?

ISO 8601 timestamp — only return tweets after this time

Returns:

  • (String, nil)


39
# File 'lib/x_twitter_scraper/models/x/tweet_search_params.rb', line 39

optional :since_time, String

#until_timeString?

ISO 8601 timestamp — only return tweets before this time

Returns:

  • (String, nil)


45
# File 'lib/x_twitter_scraper/models/x/tweet_search_params.rb', line 45

optional :until_time, String