Getting Twitter tweets
Posted: Tue Nov 27, 2012 4:29 pm
I can't work around this code
[syntax=php]
<?php
$username = "";
$password = "";
$timeline = curl_init("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=amgarak");
curl_setopt($timeline, CURLOPT_USERPWD, $username.":".$password);
curl_setopt($timeline, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($timeline);
$result = new SimpleXMLElement($result);
echo $result->status[0]->text;
?>[/syntax]
to display my tweets.
In the tutorial I saw they work fine but I can't make it work, don't know why.
Could you please help me here
[syntax=php]
<?php
$username = "";
$password = "";
$timeline = curl_init("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=amgarak");
curl_setopt($timeline, CURLOPT_USERPWD, $username.":".$password);
curl_setopt($timeline, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($timeline);
$result = new SimpleXMLElement($result);
echo $result->status[0]->text;
?>[/syntax]
to display my tweets.
In the tutorial I saw they work fine but I can't make it work, don't know why.
Could you please help me here