Class: XTwitterScraper::Models::UserProfile

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/x_twitter_scraper/models/user_profile.rb,
sig/x_twitter_scraper/models/user_profile.rbs

Direct Known Subclasses

X::TweetAuthor

Instance Attribute Summary collapse

Instance Method Summary collapse

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(id:, name:, username:, automated_by: nil, can_dm: nil, community_role: nil, cover_picture: nil, created_at: nil, description: nil, favourites_count: nil, followers: nil, following: nil, has_custom_timelines: nil, is_automated: nil, is_blue_verified: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, pinned_tweet_ids: nil, possibly_sensitive: nil, profile_bio: nil, profile_banner_url: nil, profile_picture: nil, protected: nil, statuses_count: nil, unavailable: nil, unavailable_reason: nil, url: nil, verified: nil, verified_type: nil, viewer_followed_by: nil, viewer_following: nil, withheld_in_countries: nil) ⇒ Object

X user profile with bio, follower counts, and verification status.

Parameters:

  • id (String)
  • name (String)
  • username (String)
  • automated_by (String) (defaults to: nil)
  • can_dm (Boolean) (defaults to: nil)
  • community_role (String) (defaults to: nil)

    Community role when returned by community member reads

  • cover_picture (String) (defaults to: nil)
  • created_at (String) (defaults to: nil)
  • description (String) (defaults to: nil)
  • favourites_count (Integer) (defaults to: nil)
  • followers (Integer) (defaults to: nil)
  • following (Integer) (defaults to: nil)
  • has_custom_timelines (Boolean) (defaults to: nil)
  • is_automated (Boolean) (defaults to: nil)
  • is_blue_verified (Boolean) (defaults to: nil)

    Whether X shows a blue verification badge

  • is_translator (Boolean) (defaults to: nil)
  • is_verified (Boolean) (defaults to: nil)

    Whether X marks the profile as verified

  • location (String) (defaults to: nil)
  • media_count (Integer) (defaults to: nil)
  • pinned_tweet_ids (Array<String>) (defaults to: nil)
  • possibly_sensitive (Boolean) (defaults to: nil)
  • profile_bio (Hash{Symbol=>Object}) (defaults to: nil)

    Structured profile bio with entity annotations

  • profile_banner_url (String) (defaults to: nil)

    Original X profile banner field when available

  • profile_picture (String) (defaults to: nil)
  • protected (Boolean) (defaults to: nil)

    Whether the profile protects its posts

  • statuses_count (Integer) (defaults to: nil)
  • unavailable (Boolean) (defaults to: nil)
  • unavailable_reason (String) (defaults to: nil)
  • url (String) (defaults to: nil)
  • verified (Boolean) (defaults to: nil)
  • verified_type (String) (defaults to: nil)
  • viewer_followed_by (Boolean) (defaults to: nil)

    Whether this profile follows the authenticated viewer

  • viewer_following (Boolean) (defaults to: nil)

    Whether the authenticated viewer follows this profile

  • withheld_in_countries (Array<String>) (defaults to: nil)


# File 'lib/x_twitter_scraper/models/user_profile.rb', line 190

Instance Attribute Details

#automated_byString?

Parameters:

  • (String)

Returns:

  • (String, nil)


28
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 28

optional :automated_by, String, api_name: :automatedBy

#can_dmBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

optional :can_dm, XTwitterScraper::Internal::Type::Boolean, api_name: :canDm

#community_roleString?

Community role when returned by community member reads

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :community_role, String, api_name: :communityRole

#cover_pictureString?

Parameters:

  • (String)

Returns:

  • (String, nil)


44
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 44

optional :cover_picture, String, api_name: :coverPicture

#created_atString?

Parameters:

  • (String)

Returns:

  • (String, nil)


49
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 49

optional :created_at, String, api_name: :createdAt

#descriptionString?

Parameters:

  • (String)

Returns:

  • (String, nil)


54
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 54

optional :description, String

#favourites_countInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


59
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 59

optional :favourites_count, Integer, api_name: :favouritesCount

#followersInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


64
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 64

optional :followers, Integer

#followingInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


69
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 69

optional :following, Integer

#has_custom_timelinesBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


74
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 74

optional :has_custom_timelines, XTwitterScraper::Internal::Type::Boolean, api_name: :hasCustomTimelines

#idString

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 13

required :id, String

#is_automatedBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


79
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 79

optional :is_automated, XTwitterScraper::Internal::Type::Boolean, api_name: :isAutomated

#is_blue_verifiedBoolean?

Whether X shows a blue verification badge

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


85
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 85

optional :is_blue_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isBlueVerified

#is_translatorBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


90
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 90

optional :is_translator, XTwitterScraper::Internal::Type::Boolean, api_name: :isTranslator

#is_verifiedBoolean?

Whether X marks the profile as verified

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


96
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 96

optional :is_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isVerified

#locationString?

Parameters:

  • (String)

Returns:

  • (String, nil)


101
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 101

optional :location, String

#media_countInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


106
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 106

optional :media_count, Integer, api_name: :mediaCount

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


18
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 18

required :name, String

#pinned_tweet_idsArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


111
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 111

optional :pinned_tweet_ids, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :pinnedTweetIds

#possibly_sensitiveBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


116
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 116

optional :possibly_sensitive, XTwitterScraper::Internal::Type::Boolean, api_name: :possiblySensitive

#profile_banner_urlString?

Original X profile banner field when available

Parameters:

  • (String)

Returns:

  • (String, nil)


128
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 128

optional :profile_banner_url, String, api_name: :profileBannerUrl

#profile_bioHash{Symbol=>Object}?

Structured profile bio with entity annotations

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


122
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 122

optional :profile_bio, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]

#profile_pictureString?

Parameters:

  • (String)

Returns:

  • (String, nil)


133
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 133

optional :profile_picture, String, api_name: :profilePicture

#protectedBoolean?

Whether the profile protects its posts

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


139
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 139

optional :protected, XTwitterScraper::Internal::Type::Boolean

#statuses_countInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


144
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 144

optional :statuses_count, Integer, api_name: :statusesCount

#unavailableBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


149
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 149

optional :unavailable, XTwitterScraper::Internal::Type::Boolean

#unavailable_reasonString?

Parameters:

  • (String)

Returns:

  • (String, nil)


154
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 154

optional :unavailable_reason, String, api_name: :unavailableReason

#urlString?

Parameters:

  • (String)

Returns:

  • (String, nil)


159
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 159

optional :url, String

#usernameString

Parameters:

  • value (String)

Returns:

  • (String)


23
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 23

required :username, String

#verifiedBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


164
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 164

optional :verified, XTwitterScraper::Internal::Type::Boolean

#verified_typeString?

Parameters:

  • (String)

Returns:

  • (String, nil)


169
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 169

optional :verified_type, String, api_name: :verifiedType

#viewer_followed_byBoolean?

Whether this profile follows the authenticated viewer

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


175
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 175

optional :viewer_followed_by, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowedBy

#viewer_followingBoolean?

Whether the authenticated viewer follows this profile

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


181
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 181

optional :viewer_following, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowing

#withheld_in_countriesArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


186
187
188
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 186

optional :withheld_in_countries,
XTwitterScraper::Internal::Type::ArrayOf[String],
api_name: :withheldInCountries

Instance Method Details

#to_hash{

Returns:

  • ({)


213
# File 'sig/x_twitter_scraper/models/user_profile.rbs', line 213

def to_hash: -> {