Welcome Guest, Not a member yet? Register   Sign In
Show latest tweets
#6

[eluser]mvdg27[/eluser]
I've once used something like this. Not sure if it's the best way to go about it, but I needed a quick and dirty solution at the time.

Code:
function twitter_feed($user) {
    $rss_file = 'http://twitter.com/statuses/user_timeline/'.$user.'.xml';
    $rss_feed = @file_get_contents($rss_file);
        
    if($rss_feed) {
            
        $xml = simplexml_load_string($rss_feed);
        $return = array();
        foreach($xml as $status) {
            $return[] = array(
                'datetime' => $status->created_at,
                'text' => $status->text,
                'source' => $status->source
            );
        }

    }
    else $return = 'Twitter feed not found';

    return $return;
}

Guess this should get you started. Any suggestions on this code are very welcome of course.

Michiel


Messages In This Thread
Show latest tweets - by El Forum - 10-03-2009, 01:11 PM
Show latest tweets - by El Forum - 10-03-2009, 02:00 PM
Show latest tweets - by El Forum - 10-03-2009, 02:05 PM
Show latest tweets - by El Forum - 10-03-2009, 04:33 PM
Show latest tweets - by El Forum - 10-04-2009, 05:14 AM
Show latest tweets - by El Forum - 10-04-2009, 04:13 PM
Show latest tweets - by El Forum - 10-04-2009, 11:59 PM
Show latest tweets - by El Forum - 10-05-2009, 05:46 AM
Show latest tweets - by El Forum - 10-05-2009, 05:56 AM
Show latest tweets - by El Forum - 10-05-2009, 07:59 AM
Show latest tweets - by El Forum - 10-05-2009, 08:09 AM
Show latest tweets - by El Forum - 10-05-2009, 09:00 AM
Show latest tweets - by El Forum - 10-05-2009, 09:58 AM
Show latest tweets - by El Forum - 10-05-2009, 10:22 AM
Show latest tweets - by El Forum - 10-05-2009, 02:15 PM
Show latest tweets - by El Forum - 10-05-2009, 02:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB