Skip to content

Instantly share code, notes, and snippets.

@ota42y
Created August 31, 2014 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ota42y/258616adf5087d2d2186 to your computer and use it in GitHub Desktop.
Save ota42y/258616adf5087d2d2186 to your computer and use it in GitHub Desktop.
Anacondaを使ってtwitterからツイートを取ってくる
package main
import (
"fmt"
"github.com/ChimeraCoder/anaconda"
"net/url"
)
func showTimeLine(api *anaconda.TwitterApi, v url.Values) {
tweets, err := api.GetUserTimeline(v)
if err != nil {
panic(err)
}
for _, tweet := range tweets {
fmt.Println("tweet: ", tweet.Text)
}
}
func main() {
anaconda.SetConsumerKey(CONSUMER_KEY)
anaconda.SetConsumerSecret(CONSUMER_SECRET)
api := anaconda.NewTwitterApi(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
v := url.Values{}
v.Set("screen_name", "LoveLive_staff")
showTimeLine(api, v)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment