سؤال

I have a simple text-area where someone can type a message to be tweeted on a account. I want to make a list of people re-tweet this tweet.

For as far as i know, i need the unique id of my tweet. But I don't know how to fetch this.

My post:

$twitteroauth = new TwitterOAuth('*****', '******', $oauth_token, $oauth_secret);
$twitteroauth->post('statuses/update', array('status' => $toTweet));

Can i somehow fetch the id directly from my post?

I have been searching the internet, but only seem to find ways of getting a tweet by id and not the other way around.

Thanks in advance...

هل كانت مفيدة؟

المحلول

The id of your tweet can be found in an object returned from API call:

$tweet = $twitteroauth->post('statuses/update', array('status' => $toTweet));

Now $tweet holds the details about your status update, including it's ID.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top