Documentation ¶
Overview ¶
Package stream provides methods for listening to Twitter's Streaming APIs.
To begin using you will need credentials for an app setup in Twitter. Then you can get your timeline like so,
// assuming consumerKey, consumerSecret, accessToken and accessSecret hold // the credentials auth := stream.Auth(consumerKey, consumerSecret, accessToken, accessSecret) for tweet := range.Timeline(auth) { log.Println(tweet) }
Warning, this library does not do any error handling at the moment, it ignores any incoming messages that do not look like tweets.
Index ¶
Constants ¶
View Source
const ( SAMPLE_URL = "https://stream.twitter.com/1.1/statuses/sample.json" STREAM_URL = "https://userstream.twitter.com/1.1/user.json" USER_URL = STREAM_URL + "?with=user" DETAILS_URL = "https://api.twitter.com/1.1/account/verify_credentials.json" )
View Source
const (
DIAL_TIMEOUT = 5 * time.Second
)
View Source
const (
TimeFormat = "Mon Jan _2 15:04:05 +0000 2006"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tweet ¶
Click to show internal directories.
Click to hide internal directories.