示例#1
0
// user stream 受信
func UserStream(api *anaconda.TwitterApi) {
	stream := api.UserStream(nil)
	for {
		x := <-stream.C
		switch tweet := x.(type) {
		case anaconda.Tweet:
			PrintTweet(tweet)
		case anaconda.StatusDeletionNotice:
			// pass
		default:
			fmt.Printf("unknown type(%T) : %v \n", x, x)
		}
	}
}
示例#2
0
func StartUserStream(api *anaconda.TwitterApi) *anaconda.Stream {
	v := url.Values{}
	v.Set("with", "user")
	v.Set("replies", "all")
	return api.UserStream(v)
}