Created
August 31, 2014 02:00
-
-
Save ota42y/258616adf5087d2d2186 to your computer and use it in GitHub Desktop.
Anacondaを使ってtwitterからツイートを取ってくる
This file contains 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 ( | |
"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