Class: XTwitterScraper::Resources::X::Followers

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

Overview

X data lookups (subscription required)

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Followers

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 Followers.

Parameters:



36
37
38
# File 'lib/x_twitter_scraper/resources/x/followers.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#check(source:, target:, request_options: {}) ⇒ XTwitterScraper::Models::X::FollowerCheckResponse

Check follow relationship

Parameters:

  • source (String)

    Username to check (without @)

  • target (String)

    Target username (without @)

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

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/x_twitter_scraper/resources/x/followers.rb', line 21

def check(params)
  parsed, options = XTwitterScraper::X::FollowerCheckParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "x/followers/check",
    query: query,
    model: XTwitterScraper::Models::X::FollowerCheckResponse,
    options: options
  )
end