This repository was archived by the owner on Nov 5, 2022. It is now read-only.
v0.3.0
StartStream
now accepts optional query params.
Example:
api.Stream.StartStream("?expansions=attachments.media_keys,referenced_tweets.id,author_id")
GetMessages
returns a struct which can contain an error from twitter, or it can contain your tweet bytes. It's now up to you to unmarshal the bytes into a struct your create.
go func() {
for message := range api.Stream.GetMessages() {
if message.Err != nil {
panic(message.Err)
}
// Will print something like:
//{"data":{"id":"1356479201000","text":"Look at this cat picture"},"matching_rules":[{"id":12345,"tag":"cat tweets with images"}]}
fmt.Println(string(message.Data))
}
}()
- Updated ReadMe
- Add examples directory
- Add
rulesResponseError
as a possible error returned byrulesResponse
. Learn more here: https://developer.twitter.com/en/support/twitter-api/error-troubleshooting