<?php 

$source2='http://www.spore.com/rest/assets/search/FEATURED/0/8';

$handle = fopen($source2, "r");
$contents = stream_get_contents($handle);
fclose($handle);
try {
  $xml = @new SimpleXMLElement($contents);
} catch (Exception $e) {
  die('Sorry, no Spore creations could be found.');
}

$spore = 'http://www.spore.com/';

echo '<html><body link="white" alink="white" vlink="white"> ';
echo '<table><tr>';
$i=1;
foreach($xml->asset as $asset)
{
	if(($i-1) % 4 == 0)
	{ echo '</tr><tr>'; }
echo '<td><a href="http://www.spore.com/sporepedia#qry=ast-'.$asset->id.'" target="_blank">';
echo '<img src="'.$spore.'static/thumb/'.substr($asset->id,0,3).'/'.substr($asset->id,3,3).'/'.substr($asset->id,6,3).'/'.$asset->id.'.png" width = "75" ';
echo 'title="'.$asset->name.'  by:  '.$asset->author.'"></a>';

echo '</td>';
$i++;
}

echo '</tr></table>';
echo '</body></html>';

?>