Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用twitteroauth获取tweetID_Php_Twitter - Fatal编程技术网

Php 使用twitteroauth获取tweetID

Php 使用twitteroauth获取tweetID,php,twitter,Php,Twitter,我正在使用亚伯拉罕的密码连接到推特,并发送我自己的推特,直到现在都很好。 我的问题是,当我发布我的新tweet时,我需要tweetID,但我不知道如何获得它 我使用以下代码: $tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret); // Post the status message $tweetMessage="Welcome to my mundo !!"; $tweet-&g

我正在使用亚伯拉罕的密码连接到推特,并发送我自己的推特,直到现在都很好。 我的问题是,当我发布我的新tweet时,我需要tweetID,但我不知道如何获得它

我使用以下代码:
$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);

// Post the status message
$tweetMessage="Welcome to my mundo !!";
$tweet->post('statuses/update', array('status' => $tweetMessage));

var_dump($tweet);
echo $tweet->http_code ; //$tweet->status";

?>
当我进行转储时,我找不到id_str,有人告诉我这是唯一的id

如何从该代码中获取tweetID


TIA

如果您成功地将您的tweet发布到twitter,那么当您使用

var_dump($tweet);
echo $tweet->id_str;
$tweet->id\u str将根据需要仅提供tweet id