v0.4.1
0.4.1
Summary
Changes were made to StartStream
function. You can now request additional data from each tweet with a NewStreamQueryParamsBuilder
Changes to StartStream
Before
Originally, users who start a stream would need to pass in query params as a string. Users had to ensure they included a question mark. The problem with this approach was users could use unencoded reserved characters in the query string.
err := api.stream.StartStream("?expansions=foo&meta.fields=bar,baz,biz")
In addition, if a user did not want additional data for each tweet, then they would need to use an empty string.
err := api.stream.StartStream("")
After
It is recommended users use a NewStreamQueryParamsBuilder
to build query params. Users should use the values described in twitter's documentation to fetch additional data they need for each tweet.
// Request additional data from teach tweet
streamExpansions := twitterstream.NewStreamQueryParamsBuilder().
AddExpansion("author_id").
AddTweetField("created_at").
Build()
// Start the Stream
err = api.stream.StartStream(streamExpansions)
If no expansions are needed, users can just use nil
for the url values.
err = api.stream.StartStream(nil)