Jump to content

Style xml pulled using curl in php external file?


dropfaith

Recommended Posts

Lets start with what i have working

http://www.treasuretrooper.com/api/116fcbdb1cac242e789a892ebd2a0abb/approved/xml pull that xml file (no style)

http://box1.host1free.com/~crimso/  is my current page as you see the xml file over in approved now (right side)

<?php



function getPage($url="http://www.treasuretrooper.com/api/116fcbdb1cac242e789a892ebd2a0abb/approved/xml"){
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_FRESH_CONNECT,TRUE);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_REFERER,'http://www.treasuretrooper.com/');
curl_setopt($ch,CURLOPT_TIMEOUT,10);
$html=curl_exec($ch);
if($html==false){
  $m=curl_error(($ch));
  error_log($m);
}
curl_close($ch);
return $html;
}

$html=getPage("http://www.treasuretrooper.com/api/116fcbdb1cac242e789a892ebd2a0abb/approved/xml");
$html=htmlentities($html);
echo $html; 
?>

 

I just need t get the xml styled properly and im clueless as to how id do it with the curl function involved. So any direction would help tons on this.

 

Also wondering why its showing the actual xml code tree i assumed it would only provide the information

sigh okay i cleared up all those issues  but im running into an issue with something small due to being forced to use curl im clueless on progress as i just learned it

 

i removed

$html=htmlentities($html);

 

Started styling it(im good on that now) 

BUt im having issues reversing its order right now its oldest date to newest.  I have a date field Approved_On to work with that all has info in it.

Also working on limiting the number of results to like 30  max . Again im dumb on this right now.  So anything helps

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.