Skip to content

Commit

Permalink
Implement unretweet support which return back the status normal tweet.
Browse files Browse the repository at this point in the history
  • Loading branch information
cention-mujibur-rahman committed Jun 15, 2017
1 parent d717947 commit 50c11cd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tweets.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ func (a TwitterApi) Retweet(id int64, trimUser bool) (rt Tweet, err error) {
return rt, (<-response_ch).err
}

//UnRetweet will renove retweet Untweets a retweeted status.
//Returns the original Tweet with retweet details embedded.
//
//https://dev.twitter.com/rest/reference/post/statuses/unretweet/id
//trim_user: tweet returned in a timeline will include a user object
//including only the status authors numerical ID.
func (a TwitterApi) UnRetweet(id int64, trimUser bool) (rt Tweet, err error) {
v := url.Values{}
if trimUser {
v.Set("trim_user", "t")
}
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + fmt.Sprintf("/statuses/unretweet/%d.json", id), v, &rt, _POST, response_ch}
return rt, (<-response_ch).err
}

// Favorite will favorite the status (tweet) with the specified ID.
// https://dev.twitter.com/docs/api/1.1/post/favorites/create
func (a TwitterApi) Favorite(id int64) (rt Tweet, err error) {
Expand Down

0 comments on commit 50c11cd

Please sign in to comment.