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 186

Instance Attribute Details

#automated_byString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :automated_by, String, api_name: :automatedBy

#can_dmBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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)


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

optional :community_role, String, api_name: :communityRole

#cover_pictureString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :cover_picture, String, api_name: :coverPicture

#created_atString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :created_at, String, api_name: :createdAt

#descriptionString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :description, String

#favourites_countInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :favourites_count, Integer, api_name: :favouritesCount

#followersInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :followers, Integer

#followingInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :following, Integer

#has_custom_timelinesBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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

#idString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#is_automatedBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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)


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

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

#is_translatorBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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

#is_verifiedBoolean?

Whether X marks the profile as verified

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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

#locationString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :location, String

#media_countInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :media_count, Integer, api_name: :mediaCount

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :name, String

#pinned_tweet_idsArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


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

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

#possibly_sensitiveBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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)


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

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)


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

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

#profile_pictureString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :profile_picture, String, api_name: :profilePicture

#protectedBoolean?

Whether the profile protects its posts

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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

#statuses_countInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :statuses_count, Integer, api_name: :statusesCount

#unavailableBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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

#unavailable_reasonString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :unavailable_reason, String, api_name: :unavailableReason

#urlString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :url, String

#usernameString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :username, String

#verifiedBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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

#verified_typeString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :verified_type, String, api_name: :verifiedType

#viewer_followed_byBoolean?

Whether this profile follows the authenticated viewer

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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)


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

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

#withheld_in_countriesArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


182
183
184
# File 'lib/x_twitter_scraper/models/user_profile.rb', line 182

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

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {