Пример #1
1
Файл: gotw.go Проект: yuntan/tw
// https://dev.twitter.com/rest/reference/post/statuses/destroy/%3Aid
func RemoveTweet(id string, token *oauth1.Token) (*http.Response, error) {
	Config.Endpoint = twitter.AuthenticateEndpoint
	client := oauth1.NewClient(Config, token)
	return client.PostForm(TWITTER_API+fmt.Sprintf("statuses/destroy/%s.json", id), nil)
}
Пример #2
0
Файл: gotw.go Проект: yuntan/tw
// https://dev.twitter.com/rest/reference/post/statuses/update
func Tweet(tweet string, token *oauth1.Token) (*http.Response, error) {
	Config.Endpoint = twitter.AuthenticateEndpoint
	client := oauth1.NewClient(Config, token)
	return client.PostForm(TWITTER_API+"statuses/update.json",
		url.Values{"status": []string{tweet}})
}
Пример #3
0
Файл: gotw.go Проект: yuntan/tw
// https://dev.twitter.com/rest/reference/get/statuses/mentions_timeline
func GetMentions(token *oauth1.Token) (*http.Response, error) {
	Config.Endpoint = twitter.AuthenticateEndpoint
	client := oauth1.NewClient(Config, token)
	return client.Get(TWITTER_API + "statuses/mentions_timeline.json")
}
Пример #4
0
Файл: gotw.go Проект: yuntan/tw
// https://dev.twitter.com/rest/reference/get/account/verify_credentials
func VerifyCredentials(token *oauth1.Token) (*http.Response, error) {
	Config.Endpoint = twitter.AuthenticateEndpoint
	client := oauth1.NewClient(Config, token)
	return client.Get(TWITTER_API + "account/verify_credentials.json")
}