Help with Twitter ID_Str
I'm really new on php and twitter oauth and I'm on my learning.. I'm confused when dealing with id_str
I want to know how to get id_str using oauth (on twitter client such as dabr, etc) you'll often see tweet ti开发者_运维百科me (posted 52 minutes ago, etc) and when you click it will got to single tweet page --live example http://twitter.com/#!/twitterapi/status/4917112329994240
I have no idea how to get/request this number "4917112329994240"
part of my code:
$consumer = new
OAuthConsumer(OAUTH_CONSUMER_KEY,
OAUTH_CONSUMER_SECRET); $sha1_method
= new OAuthSignatureMethod_HMAC_SHA1();
// user's token list($oauth_token,
$oauth_token_secret) = explode('|',
$GLOBALS['user']['password']);
$token = new
OAuthConsumer($oauth_token,
$oauth_token_secret);
// Generate all the OAuth parameters needed $signingURL =
'https://api.twitter.com/1/account/verify_credentials.json';
$request =
OAuthRequest::from_consumer_and_token($consumer,
$token, 'GET', $signingURL, array());
$request->sign_request($sha1_method,
$consumer, $token);
$header[1] .= ", oauth_consumer_key=\"" .
$request->get_parameter('oauth_consumer_key')
. "\""; $header[1] .= ",
oauth_signature_method=\"" .
$request->get_parameter('oauth_signature_method')
."\""; $header[1] .= ",
oauth_token=\"" .
$request->get_parameter('oauth_token')
."\""; $header[1] .= ",
oauth_timestamp=\"" .
$request->get_parameter('oauth_timestamp')
."\""; $header[1] .= ",
oauth_nonce=\"" .
$request->get_parameter('oauth_nonce')
."\""; $header[1] .= ",
oauth_version=\"" .
$request->get_parameter('oauth_version')
."\""; $header[1] .= ",
oauth_signature=\"" .
urlencode($request->get_parameter('oauth_signature'))
."\"";
$twtid =
$request->get_parameter('id_str');
didn't return any result
I'm one of the developers of Dabr.
To retrieve a single status from the API, use this call
https://api.twitter.com/1/statuses/show/4917112329994240.json?include_entities=true
You will, of course, have to sign your request with OAuth.
精彩评论