Пример #1
0
func postTweet(status string) {
	fmt.Println("Post Added in Twitter Stream " + twitter.AccessToken)
	params := twitter.GetHeadersMap()
	params.Set("status", status)
	method := "POST"
	endUrl := "/1.1/statuses/update.json"
	header := twitter.PrepareOAuthHeaders(method, endUrl, params)
	response := utils.ProcessRequest(method, header, twitter.ApiUrl+endUrl+"?status="+utils.Encode(status, false), nil)
	fmt.Println(string(response))
}
Пример #2
0
func listTweets() {
	fmt.Println("List of Tweets " + twitter.AccessToken)
	params := twitter.GetHeadersMap()
	params.Set("screen_name", twitter.ScreenName)
	params.Set("count", "2")
	method := "GET"
	endUrl := "/1.1/statuses/user_timeline.json"
	header := twitter.PrepareOAuthHeaders(method, endUrl, params)
	params = url.Values{}
	params.Set("screen_name", twitter.ScreenName)
	params.Set("count", "2")
	response := utils.ProcessRequest(method, header, twitter.ApiUrl+endUrl+"?"+params.Encode(), nil)
	fmt.Println(string(response))
}