Dipendra Gurung
Dipendra Gurung

Reputation: 5870

How to authorize and fetch twitter user's timeline via api

I am a newbie to oAuth and twitter api, what I want to do is fetch user's timeline. I have registered my app and have got my keys. Is there any simple method to authenticate and fetch the data in php? I don't want to use any external libraries and class for now because I want to learn the internal workings too. :)

Here are my basic cURL request code:

$url = 'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=user';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output=curl_exec($ch);
curl_close($ch);
echo $output;

But how to authenticate???

Upvotes: 0

Views: 96

Answers (1)

Barnabas Kecskes
Barnabas Kecskes

Reputation: 1951

I would suggest the course of Ray Villalobos, an author at lynda.com - he tells you how to do such a thing on his website. Good luck!

Upvotes: 1

Related Questions