Skip to content

Instantly share code, notes, and snippets.

@misodengaku
Created June 18, 2015 03:01
Show Gist options
  • Save misodengaku/6a1ade5a3c34f59e5c84 to your computer and use it in GitHub Desktop.
Save misodengaku/6a1ade5a3c34f59e5c84 to your computer and use it in GitHub Desktop.
package main
import (
"github.com/ChimeraCoder/anaconda"
"net/url"
"fmt"
)
func main() {
anaconda.SetConsumerKey("CONSUMER_KEY")
anaconda.SetConsumerSecret("CONSUMER_SECRET")
api := anaconda.NewTwitterApi("ACCESS_TOKEN", "ACCESS_TOKEN_SECRET")
params := url.Values{}
params.Add("track", "#superfuckjp")
stream := api.PublicStreamFilter(params)
fmt.Println("connected.")
fmt.Printf("%#d\n", stream)
for true {
//tweet_if <- stream.C
tweet_if := <-stream.C
tweet, _ := tweet_if.(anaconda.Tweet)
go func() {
fmt.Printf("recieved: %#v\n", tweet)
api.Retweet(tweet.Id, false)
}()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment