I'm using the following code to parse XML data from Justin.tv To show viewers for specific channels... The problem is I have 30 different xml files to pull from...1 for each channel.. ie this channel is tibtie/meta.xml another is justin/meta.xml When I load the page it just freezes... I assume the problem is that xpath is trying to open up 30 sockets at once to connect. Is there a way I can put a load order? Where it will parse em in a row ? Say 1/meta.xml then 2/meta.xml So on and so forth.
I've also tried the below method then echo the matching data to its proper location... works for the first 8 if I load more than that it freezes again...
Code:
<?php
require("XPath.class.php");
$tibtie = new XPath();
$tibtie->importFromFile("http://www.justin.tv/tibtie/meta.xml");
$tibtiev = $tibtie->getData('//viewers');
$myowl = new Xpath();
$myowl->importFromfile("http://www.justin.tv/myowl/meta.xml");
$myowlv = $myowl->getData('//viewers');
$ahhyeah = new Xpath();
$ahhyeah->importFromfile("http://www.justin.tv/ahhyeahforchrist/meta.xml");
$ahhyeahv = $ahhyeah->getData('//viewers');
$ron = new Xpath();
$ron->importFromfile("http://www.justin.tv/ronaldlewis/meta.xml");
$ronv = $ron->getData('//viewers');
$justin = new Xpath();
$justin->importFromfile("http://www.justin.tv/justin/meta.xml");
$justinv = $justin->getData('//viewers');
$justine = new Xpath();
$justine->importFromfile("http://www.justin.tv/ijustine/meta.xml");
$justinev = $justine->getData('//viewers');
$lisa = new Xpath();
$lisa->importFromfile("http://www.justin.tv/nekomimi_lisa/meta.xml");
$lisav = $lisa->getData('//viewers');
$morf = new Xpath();
$morf->importFromfile("http://www.justin.tv/starving_artist/meta.xml");
$morfv = $morf->getData('//viewers');
?>