PHP file is taking too long to load (Includes call to Vimeo API)

softzyh

New Member
I have a PHP file that calls specific albums from Vimeo album XMLs, and then displays them in a table.Pretty standard - except it's taking a long time to load.What would cause this to happen?Here is some of the code (with album ids changed.)\[code\]$trainingAlbums = array(1234567, 1234567, 1234567, 1234567, 1234567, 1234567, 1234567);foreach($trainingAlbums as $albumID) {$albumInfo = new SimpleXMLElement('http://vimeo.com/api/v2/album/' . $albumID . '/info.xml', null, true);$videos = new SimpleXMLElement('http://vimeo.com/api/v2/album/' . $albumID . '/videos.xml', null, true);foreach($albumInfo as $album) {echo <<<EOF<table style="width: 745px;" class="videoCategory"> <tr style="height: 10px;"><td class="VideoTitle" style="padding-left: 10px; font-weight: bold; background-color: #bdd2e8; text-align: justify;" colspan="3"><span style="font-size: 12pt; color: #000000;">{$album->title}</span></td></tr>EOF;}foreach($videos as $video) // loop through our videos{$minutes = floor($video->duration/60);$secondsleft = $video->duration%60;if($secondsleft<10)$secondsleft = "0" . $secondsleft; echo <<<EOF <tr> <td id="videoTitle" style="padding-left: 25px;"> <a class="modal" href="http://player.vimeo.com/video/{$video->id}" rel="{handler:'iframe',size:{x:990,y:650}}"> <span style="font-size: 10pt;">{$video->title}</span> </a> </td> <td style="height: 20px; text-align: center;"> <a class="modal" href="http://player.vimeo.com/video/{$video->id}" rel="{handler:'iframe',size:{x:990,y:650}}">$minutes:$secondsleft</a> </td> <td align="center"><a class="modal" href="http://player.vimeo.com/video/{$video->id}" rel="{handler:'iframe',size:{x:990,y:650}}"><img style="margin-bottom: 1px;" src="http://stackoverflow.com/images/blue-play.png" alt="blue-play" width="20" height="20"></a><a href="http://stackoverflow.com/downloads/videos/{$video->id}.mp4"><img title="To download: Right click and 'Save as...'" src="http://stackoverflow.com/images/download-icon.png" alt="download-icon" width="23" height="23"></a> </td> </tr> EOF; } echo '</table>';}\[/code\]
 
Back
Top