Topic: XML > proxy > parse > AGGGGGHHHHH! (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28948" title="Pages that link to Topic: XML &amp;gt; proxy &amp;gt; parse &amp;gt; AGGGGGHHHHH! (Page 1 of 1)" rel="nofollow" >Topic: XML &gt; proxy &gt; parse &gt; AGGGGGHHHHH! <span class="small">(Page 1 of 1)</span>\

 
FatRod
Bipolar (III) Inmate

From: #UK SURREY
Insane since: May 2002

posted posted 02-15-2007 17:54

Hi Guys - I didn't want this indexed so posted it here, hope you don?t mind.

Carrying on from this post http://www.ozoneasylum.com/28336 I have not been able to find a solution even tho I have been pointed in the right direction, jeez I have tried. I really tried.

Basically I was hoping someone can code this for me... Ok I know the idea is you guys help me learn to do stuff, in fact I have obtained a job that part utilises the skills i have learned via direction from you guys. For this I thank you. But I am stuck!
I would not expect anyone to do this for free so I am happy to offer payment in the way of some excellent objects ? all brand spaning new one of these & two of these (in silver) [postage and packaging included]

just to recap - I have this xml output feed http://jobs.cerebra.co.uk/xml.php?number=5 which is hosted on another site. I need this to be displayed on the home page of my domain. I can't change the output script.

From the help already received it has been suggested a server side proxy is used to pull the data into our servers, then I guess the xml file would be parsed? somehow.

I really appreciate any help here.

Cheers

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 02-15-2007 19:29

This is actually pretty simple.

I am guessing that you want to take a list form a external site and display their links on your site?

So what you do is the following:

1. Create a php page using the TP supplied code.

code:
<?php
function fetchRemoteURL ( $strURL ) 
{
 $strResult = '';
 $fh = fopen ( $strURL, "rb");
  if ( $fh ) 
  {
     while ( !feof ( $fh ) ) 
       $strResult .= fread ( $fh, 8192 ) ;
  }
 return $strResult;

}
header('Content-type: text/xml');
print fetchRemoteURL('http://jobs.cerebra.co.uk/xml.php?number=5');
?>



2. Upload this page to your web server. You will now be able to call it via http://yoursite.com/yourfile.php since the XML now appears to come from your site you have gotten around the off site issue.

3. Now you can use your JavaScript knowledge to parse this file and do the display stuff based on the AJAX stuff you mentioned before.

Dan
Code Town | Zombie Head

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 02-15-2007 20:53

Check this out:
http://www.howtocreate.co.uk/tutorials/jsexamples/rss.html

You might not need his parsing code since your feed is XML but is not RSS, but studying his "passthrough" script might be an interesting read.

FatRod
Bipolar (III) Inmate

From: #UK SURREY
Insane since: May 2002

posted posted 02-16-2007 13:48

Thanks Dan!

ok we are getting there kinda http://www.cerebra.co.uk/xml.php

Then using simple XSL called by JS we have http://www.cerebra.co.uk/index2.shtml but it is not importing the data - i guess this is because i need a .xml file extention rather than .php. Done a bit of googling but no joy.

is there an easy way to import a php file with a xml doctype into a xml file on the fly without duplicating doctypes?

Dan: i think you deserve a prize - email me

Cheers

Ben

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 02-16-2007 15:08

I would not use an IE specific means of parsing the XML file.

http://www.codetown.org/examples/xml-test/

The example above uses the prototype javascript library to parse the XML file. You should not have to worry about file extensions or anything like that. The XML data you are putting out there is fine.

You should be thanking TP and not me, he is the one who supplied the code you needed.

Dan
Code Town | Zombie Head

FatRod
Bipolar (III) Inmate

From: #UK SURREY
Insane since: May 2002

posted posted 02-16-2007 15:53

Many thanks Dan - it looks like that took you some time!!!!

TP can have a pen as well if he likes

http://www.cerebra.co.uk/jobs.htm

Cheers

Ben

Ben Corke | IT Recruitment Consultant | ben@cerebra.co.uk | www.cerebra.co.uk

FatRod
Bipolar (III) Inmate

From: #UK SURREY
Insane since: May 2002

posted posted 08-13-2007 11:24

I've just realised that google bots are not reading the content generated by the AJAX request.... Does anyone know a simple alternitive that will produce a static page that is indexible by search engines???

this is a major problem with AJAX!

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 08-13-2007 18:28

Here you go http://test.coonabibba.de/fatrod.phps
(and http://test.coonabibba.de/fatrod.php to see it in action),

a php script that does pretty much the same and I guess you can just adjust formating as you need and include it in a
<noscript> section...

now, I'd really like that pen

So long,

->Tyberius Prime

FatRod
Bipolar (III) Inmate

From: #UK SURREY
Insane since: May 2002

posted posted 08-15-2007 14:41

Thanks TP, Thanks.

I'll get one in the post right away, check mail.

cheers

ben



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu