Simple Twitter Streaming API for Golang. #golang
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 16 commits ahead, 1 commit behind otiai10:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
sample_data
.gitignore
README.md
all_test.go
api.go
event.go
example_test.go
properties.go
status.go
stream.go
test.conf.sample
timeline.go

README.md

Twitter Streaming API

The very simplest interface to use Twitter Streaming API by golang. This is forked from https://github.com/otiai10/twistream.

Usage

timeline := twistream.New(
    "https://userstream.twitter.com/1.1/user.json",
    CONSUMERKEY,
    CONSUMERSECRET,
    ACCESSTOKEN,
    ACCESSTOKENSECRET,
    map[string]string{
        with: "followers",
    },
)

// Listen timeline
ch, _ := timeline.Listen()
for {
    status := <-ch
    fmt.Println(status)
}

// Tweet to timeline
status := twistream.Status{
    Text: "@otiai10 How does Go work?",
    InReplyToStatusId: 493324823926288386,
}
_ := timeline.Tweet(status)

TODOs

  • GET user
  • GET site
  • GET statuses/sample
  • GET status/firehose
  • POST statuses/filter
  • POST statuses/update
  • POST statuses/update_with_media