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

v0.3.0

Choose a tag to compare

@Fallenstedt Fallenstedt released this 02 Feb 06:20
· 63 commits to master since this release
924bfc8
api.Stream.StartStream("?expansions=attachments.media_keys,referenced_tweets.id,author_id")
  • GetMessages returns a struct which can contain an error from twitter, or it can contain your tweet bytes. It's now up to you to unmarshal the bytes into a struct your create.
	go func() {
		for message := range api.Stream.GetMessages() {
			if message.Err != nil {
				panic(message.Err)
			}
                        // Will print something like: 
                        //{"data":{"id":"1356479201000","text":"Look at this cat picture"},"matching_rules":[{"id":12345,"tag":"cat tweets with images"}]}
			fmt.Println(string(message.Data))
		}
	}()