views:

119

answers:

3

How can I retrieve all the direct messages of inbox of my twitter account using token oauth OR curl in PHP?

+4  A: 

Did you, perhaps, consider checking the Twitter API documentation and OAuth examples before posting this question? Were they somehow lacking?

http://apiwiki.twitter.com/OAuth-Examples

http://www.jaisenmathai.com/blog/2009/03/31/how-to-quickly-integrate-with-twitters-oauth-api-using-php/comment-page-1/

http://apiwiki.twitter.com/Twitter-REST-API-Method:-direct_messages

Chuck
A: 

Dear Chuck,

When I just test the url http://api.twitter.com/1/direct_messages.xml?page=3,I got error

Basic authentication is not supported

even I have already login at twitter.

james
So do you want to use basic authentication or OAuth? You're not even trying to do this on your own, are you?
Chuck
ok boss i have tried as
JAMES
A: 

ok boss.. I have tried as

 <?php
include_once "config.php";
$token='RRRRRDDDXXXXXXXX@##W#22222';
$secret='XXXXXXXXXXXXXXXXXXXXXX';
 $to = new TwitterOAuth($consumer_key, $consumer_secret, $token, $secret);
 $url_status="http://api.twitter.com/1/direct_messages.xml?page=3";
 $do_dm=simplexml_load_string($to->OAuthRequest($url_status, 'GET',array()));
 foreach ($do_dm->status as $twit1)                                    {                                                                                
$description = $twit1->text;                                       print_r($description);                                    
 }
 ?>

but didn't get any result? when I checked line 6.. I got the error like "Incorrect signature".. is it wrong?

JAMES
Four spaces in front of a line will make it format like code. To do this efficiently highlight a block and press `Ctr+K` - Additionally, this isn't an answer. You should edit your question instead.
Peter Ajtai