简体   繁体   English

Twitter API-回复转发

[英]Twitter API - Reply to a retweet

I am writing a little twitter API (using Elliot Haughin's library ) and I want to reply to a retweet that the app posts. 我正在编写一个小的twitter API(使用Elliot Haughin的library ),我想回复该应用发布的转发。

I have read the docs for statues/update , and have tried using '*in_reply_to_status_id*' with the value taken from '*user_mentions*', but it doesn't seem to work. 我已经阅读了Statues / update的文档,并尝试将'* in_reply_to_status_id *'与'* user_mentions *'的值一起使用,但是它似乎不起作用。

What am I doing wrong, or is there a better way to do it? 我做错了什么,还是有更好的方法呢?

Code sample; 代码样本;

$answer = '@'.$retweet->entities->user_mentions[0]->screen_name.' thanks!!';
$this->tweet->call('post', 'statuses/update', array('status' => $answer, 'in_reply_to_status_id' => $retweet->id));

You should include the name of the user who retweeted the post, and not the one that was mentioned in the post. 您应该包括转发该帖子的用户名,而不是该帖子中提到的用户名。

$answer = '@'.$retweet->user->screen_name.' thanks!!';

Of cource, for this to work, you should request the tweets with include_entities => 1 当然,为此,您应该使用include_entities => 1请求推文

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM