Can't retrieve latest followers's tweets

4 views
Skip to first unread message

humbucker

unread,
Dec 29, 2009, 8:35:09 AM12/29/09
to Twitter Development Talk
Hi!

The code below just produce a blank result when trying to list my
followers's latest tweet
N.B. It's working if I filter something else in the query, like
@replies, timeline users or so...

<?php
$login = "myID:myPW";
$curl_conn = curl_init();
$request = "https://twitter.com/statuses/followers/myID.xml?count=9";
curl_setopt($curl_conn, CURLOPT_URL, $request); //URL to connect to
curl_setopt($curl_conn, CURLOPT_GET, 1); //Use GET method
curl_setopt($curl_conn, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl_conn, CURLOPT_USERPWD, $login); //Set u/p
curl_setopt($curl_conn, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_conn, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl_conn);
$tweeters = new SimpleXMLElement($output);

$latesttweets = count($tweeters);

foreach ($tweeters->status as $twit1) {

echo "<div class='user'><a href=\"http://www.twitter.com/", $twit1-
>user->screen_name,"\" target=\"_blank\"><img border=\"0\" class=
\"twitter_followers\" src=\"", $twit1->user->profile_image_url, "\"
title=\"", $twit1->name, "\" /></a>\n";
echo "</div>";}
curl_close($curl_conn);

Thank you!

humbucker

unread,
Dec 29, 2009, 10:20:48 AM12/29/09
to Twitter Development Talk
Ok I've found, the generated xml is not organizeed the same way,
instead of <statuses><status>...it's <users><users>

Cheers!

Reply all
Reply to author
Forward
0 new messages