ChimeraCoder / anaconda

A Go client library for the Twitter 1.1 API
MIT License
1.14k stars 247 forks source link

Don't set list_id in GetListTweets when listID is zero #132

Open tSU-RooT opened 8 years ago

tSU-RooT commented 8 years ago

Twitter API lists/statuses requires 'list_id' or 'slug',

I tested GetListTweets with slug and other required parameters, like this below.

Sample Code:

api := anaconda.NewTwitterApi(Token, TokenSecret)
val := url.Values{}
val.Add("owner_screen_name", "foo")
val.Add("slug", "bar")

tweets, err := api.GetListTweets(0, true, val)
// An error occurs!
if err != nil {
    panic(err)
}

If listID is zero, ignore it and we can use the lists API.

muesli commented 7 years ago

@tSU-RooT: Similar to #157, I'd prefer a convenience method to get lists by slug. What do you think?