Go library to access Twitter's Streaming API.
Documentation: http://godoc.org/github.com/gedex/go-twitterstream/twitterstream
config := &twitterstream.Config{
ConsumerKey: "YOUR CONSUMER KEY",
ConsumerSecret: "YOUR CONSUMER SECRET",
OAuthToken: "YOUR OAUTH TOKEN",
OAuthTokenSecret: "YOUR OAUTH TOKEN SECRET",
}
client := twitterstream.NewClient(config)
client.HandleFunc("tweet", func(s *twitterstream.Stream) {
log.Printf("user %v tweets: %v\n", s.Tweet.User.ScreenName, s.Tweet.Text)
})
err := client.Public.Sample()
if err != nil {
log.Fatal(err)
}
Please see examples for a complete example.
- twitterstream for Go
- tweetstream RubyGem
- Twitter Platform Documentation
This library is distributed under the BSD-style license found in the LICENSE.md file.