Exemplo n.º 1
0
// public stream 受信
func PublicStream(api *anaconda.TwitterApi) {
	stream := api.PublicStreamSample(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)
		}
	}
}