// 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) } } }
func StartUserStream(api *anaconda.TwitterApi) *anaconda.Stream { v := url.Values{} v.Set("with", "user") v.Set("replies", "all") return api.UserStream(v) }