From 56584d16a7301d1ae66a5f37f1224db1f795ef90 Mon Sep 17 00:00:00 2001 From: Alex Fallenstedt Date: Sat, 9 Jan 2021 11:19:26 -0800 Subject: [PATCH] update readme example --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a1cf081..f45a027 100644 --- a/README.md +++ b/README.md @@ -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() { @@ -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