Random user PHP
Posted: Mon Nov 09, 2009 8:13 am
Hi,
I'm working on a Flash twitter feed which uses PHP to generate an xml file, which in turn the Flash file reads. If I specify a twitter account then this all works fine, but I need it to randomly display one of multiple account feeds. Here's the PHP I have so far which reads the one account, is there a way to include all the different accounts and have it pick one at random?
Any help with this would really be appreciated as I seem to be going round in circles at the moment..
Thanks,
Tom
I'm working on a Flash twitter feed which uses PHP to generate an xml file, which in turn the Flash file reads. If I specify a twitter account then this all works fine, but I need it to randomly display one of multiple account feeds. Here's the PHP I have so far which reads the one account, is there a way to include all the different accounts and have it pick one at random?
Code: Select all
<?php
$feedContent = file_get_contents("http://twitter.com/statuses/user_timeline/username1.xml" );
if( $feedContent == "" ){
exit;
}
else
{
$newfile="twitterFeed.xml";
$file = fopen ($newfile, "w");
fwrite($file, $feedContent);
fclose ($file);
}
?>
Thanks,
Tom