<commit_before>#tw
A new and simple Twitter API client.

# Usage

```go
package main

import (
    "fmt"
    "log"
    "os"

    "github.com/rendon/tw"
)

func main() {

    // Create new client
    tc := tw.NewClient()

    // Set keys
    ck := os.Getenv("TWITTER_CONSUMER_KEY")
    cs := os.Getenv("TWITTER_CONSUMER_SECRET")
    if err := tc.SetKeys(ck, cs); err != nil {
        log.Fatalf("Failed to setup client")
    }

    // GET users/show
    data, err := tc.UsersShow("twitterdev")
    if err != nil {
        log.Fatalf("Failed to obtain user: %s", err)
    }

    fmt.Printf("User ID: %s\n", data["id_str"].(string))
    fmt.Printf("User name: %s\n", data["screen_name"].(string))
}
```

The client was designed to use multiple sets of keys, if you reach the rate limit, just call `SetKeys()` with a new set of keys and keep going.

# Detect "Too Many Requests"
If your client reaches the rate limit, `err` will be equal to `ErrTooManyRequests`, you can handle this case as follows:<commit_msg>Fix example in README<commit_after>#tw
A new and simple Twitter API client.

# Usage

```go
package main

import (
    "fmt"
    "log"
    "os"

    "github.com/rendon/tw"
)

func main() {

    // Create new client
    tc := tw.NewClient()

    // Set keys
    ck := os.Getenv("TWITTER_CONSUMER_KEY")
    cs := os.Getenv("TWITTER_CONSUMER_SECRET")
    if err := tc.SetKeys(ck, cs); err != nil {
        log.Fatalf("Failed to setup client")
    }

    // GET users/show
    data, err := tc.GetUsersShow("twitterdev")
    if err != nil {
        log.Fatalf("Failed to obtain user: %s", err)
    }

    fmt.Printf("User ID: %s\n", data["id_str"].(string))
    fmt.Printf("User name: %s\n", data["screen_name"].(string))
}
```

The client was designed to use multiple sets of keys, if you reach the rate limit, just call `SetKeys()` with a new set of keys and keep going.

# Detect "Too Many Requests"
If your client reaches the rate limit, `err` will be equal to `ErrTooManyRequests`, you can handle this case as follows:
{'fraction_non_alphanumeric': 0.1382716049382716, 'fraction_numerical': 0.0, 'mean_word_length': 2.95703125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7069139', 'n_tokens_mistral': 702, 'n_tokens_neox': 687, 'n_words': 230}