Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Aug 5, 2023
1 parent 8d4d518 commit eb75e45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## [Unreleased]

- Allow configuration of content type (f33a732)

## [0.3.0] - 2023-08-04

- Add accessors to X::Client (e61fa73)
- Add configurable read timeout (41502b9)
- Handle network-related errors (9ed1fb4)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ If bundler is not being used to manage dependencies, install the gem by executin
## Usage

```ruby
oauth_credentials = {
x_oauth_credentials = {
api_key: "INSERT YOUR X API KEY HERE",
api_key_secret: "INSERT YOUR X API KEY SECRET HERE",
access_token: "INSERT YOUR X API ACCESS TOKEN HERE",
access_token_secret: "INSERT YOUR X API ACCESS TOKEN SECRET HERE",
}

# Initialize X API client with OAuth credentials
x_client = X::Client.new(**oauth_credentials)
x_client = X::Client.new(**x_oauth_credentials)

# Request yourself
x_client.get("users/me")
Expand All @@ -38,13 +38,13 @@ x_client.delete("tweets/#{tweet["data"]["id"]}")
# {"data"=>{"deleted"=>true}}

# Initialize an API v1.1 client
v1_client = X::Client.new(base_url: "https://api.twitter.com/1.1/", **oauth_credentials)
v1_client = X::Client.new(base_url: "https://api.twitter.com/1.1/", **x_oauth_credentials)

# Request your account settings
v1_client.get("account/settings.json")

# Initialize an X Ads API client
ads_client = X::Client.new(base_url: "https://ads-api.twitter.com/12/", **oauth_credentials)
ads_client = X::Client.new(base_url: "https://ads-api.twitter.com/12/", **x_oauth_credentials)

# Request your ad accounts
ads_client.get("accounts")
Expand Down

0 comments on commit eb75e45

Please sign in to comment.