Example #1
0
// ツイート
func tweet(queue Queue, client *oauth.Consumer, accessToken *oauth.AccessToken) error {
	_, err := client.PostForm(
		"https://api.twitter.com/1.1/statuses/update.json",
		map[string]string{"status": queue.Text},
		accessToken,
	)
	return err
}
Example #2
0
// お気に入り
func favorite(queue Queue, client *oauth.Consumer, accessToken *oauth.AccessToken) error {
	_, err := client.PostForm(
		"https://api.twitter.com/1.1/favorites/create.json",
		map[string]string{"id": queue.TweetId},
		accessToken,
	)
	return err
}
Example #3
0
// リツイート
func retweet(queue Queue, client *oauth.Consumer, accessToken *oauth.AccessToken) error {
	_, err := client.PostForm(
		fmt.Sprintf("https://api.twitter.com/1.1/statuses/retweet/%s.json", queue.TweetId),
		nil,
		accessToken,
	)
	return err
}