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://apiwiki.twitter.com/Twitter-REST-API-Method:-direct_messages
Chuck
2010-09-16 11:44:01
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
2010-09-17 03:24:39
So do you want to use basic authentication or OAuth? You're not even trying to do this on your own, are you?
Chuck
2010-09-17 11:47:33
ok boss i have tried as
JAMES
2010-09-18 05:27:14
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
2010-09-18 05:32:00
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
2010-09-18 08:33:50