Class: XTwitterScraper::Resources::X::Profile
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::X::Profile
- Defined in:
- lib/x_twitter_scraper/resources/x/profile.rb
Overview
X write actions (tweets, likes, follows, DMs)
Instance Method Summary collapse
-
#initialize(client:) ⇒ Profile
constructor
private
A new instance of Profile.
-
#update(account:, description: nil, location: nil, name: nil, url: nil, request_options: {}) ⇒ XTwitterScraper::Models::X::ProfileUpdateResponse
Update X profile.
-
#update_avatar(account:, file:, request_options: {}) ⇒ XTwitterScraper::Models::X::ProfileUpdateAvatarResponse
Update profile avatar.
-
#update_banner(account:, file:, request_options: {}) ⇒ XTwitterScraper::Models::X::ProfileUpdateBannerResponse
Update profile banner.
Constructor Details
#initialize(client:) ⇒ Profile
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 Profile.
91 92 93 |
# File 'lib/x_twitter_scraper/resources/x/profile.rb', line 91 def initialize(client:) @client = client end |
Instance Method Details
#update(account:, description: nil, location: nil, name: nil, url: nil, request_options: {}) ⇒ XTwitterScraper::Models::X::ProfileUpdateResponse
Update X profile
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/x_twitter_scraper/resources/x/profile.rb', line 27 def update(params) parsed, = XTwitterScraper::X::ProfileUpdateParams.dump_request(params) @client.request( method: :patch, path: "x/profile", body: parsed, model: XTwitterScraper::Models::X::ProfileUpdateResponse, options: ) end |
#update_avatar(account:, file:, request_options: {}) ⇒ XTwitterScraper::Models::X::ProfileUpdateAvatarResponse
Update profile avatar
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/x_twitter_scraper/resources/x/profile.rb', line 51 def update_avatar(params) parsed, = XTwitterScraper::X::ProfileUpdateAvatarParams.dump_request(params) @client.request( method: :patch, path: "x/profile/avatar", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse, options: ) end |
#update_banner(account:, file:, request_options: {}) ⇒ XTwitterScraper::Models::X::ProfileUpdateBannerResponse
Update profile banner
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/x_twitter_scraper/resources/x/profile.rb', line 76 def (params) parsed, = XTwitterScraper::X::ProfileUpdateBannerParams.dump_request(params) @client.request( method: :patch, path: "x/profile/banner", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: XTwitterScraper::Models::X::ProfileUpdateBannerResponse, options: ) end |