Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Commit

Permalink
update readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallenstedt committed Jan 9, 2021
1 parent dfae492 commit 56584d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func startStreaming() {

// With an access token, you can create a new twitterstream and start streaming
api := twitterstream.NewTwitterStream(token.AccessToken)
api.Stream.StartStream()
err := api.Stream.StartStream()
if err != nil {
panic(err)
}

// If you do not put this in a go routine, you will stream forever
go func() {
Expand Down Expand Up @@ -77,6 +80,7 @@ func addRules() {
// With an access token, you can create a new twitterstream and start adding rules
api := twitterstream.NewTwitterStream(token.AccessToken)


// You can add rules by passing in stringified JSON with the rules you want to add
// You can learn more about building rules here: https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/integrate/build-a-rule
// Or here: https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/post-tweets-search-stream-rules
Expand Down

0 comments on commit 56584d1

Please sign in to comment.