Created
June 18, 2015 03:01
-
-
Save misodengaku/6a1ade5a3c34f59e5c84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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