Accessing a URL

Accessing a URL

am 01.02.2008 10:08:44 von SirFlibble

Hi All,

I'm not a programmer these days (been years since I have and since
become a lawyer... don't hate me) but a friend asked for a favour and
it's been a while since I cracked out even a basic piece of code so I
said ok.

Anyhow, this script needs to read an RSS feed at the following extremely
long and annoying URL. From what I can work out )my friend didn't know
either) it's a PHP script that publishes the data as an RSS feed. The
URL is as follows.

http://www.mylegalcareer.com.au/content.php/jobresults.html? form_search_e
mployerid=&form_search_employer_label=&form_search_locality= &form_search_
state=&form_search_employertype%5B%5D=&form_search_jobtype%5 B%5D=&form_se
arch_practice%5B%5D=&form_search_jobcategory%5B%5D=&form_sub mit_x=24&form
_submit_y=11&form_submit=Submit&rss=1

Now I've written a small script which essentially reads the output from
that script (which I saved into a file for testing) and prints out the
and <link> elements as a new webpage. The ultimate goal is the <br /> actively feed off the RSS feed and present it in a nice HTML form in an <br /> iframe (which will be used on several websites). <br /> <br /> So my question (after my long winded explanation) is how do I access <br /> this data via it's URL? I can't seem to work it out. <br /> <br /> The code is as follows. <br /> <br /> <?php <br /> if(!$xml=simplexml_load_file('test.xml')){<br /> trigger_error('Error reading XML file',E_USER_ERROR);<br /> }<br /> for ($x = 0; $x<9; $x++) {<br /> echo '<a href=' . $xml->channel[0]->item[$x]->link . '>'. <br /> $xml->channel[0]->item[$x]->title . '</a><br>';<br /> }<br /> ?><br /> <br /> Thanks in advance for any help you can give me... it's been a fun <br /> challenge to even get to this point.</p> </article> <article> <h2>Re: Accessing a URL</h2><span>am 01.02.2008 13:25:26 von colin.mckinnon</span> <p>On 1 Feb, 09:08, SirFlibble <nospample...@garbagetodel.flibbled.com><br /> wrote:<br /> > Hi All,<br /> ><br /> > I'm not a programmer these days (been years since I have and since<br /> > become a lawyer... don't hate me) but a friend asked for a favour and<br /> > it's been a while since I cracked out even a basic piece of code so I<br /> > said ok.<br /> ><br /> > Anyhow, this script needs to read an RSS feed at the following extremely<br /> > long and annoying URL. From what I can work out )my friend didn't know<br /> > either) it's a PHP script that publishes the data as an RSS feed. The<br /> > URL is as follows.<br /> ><br /> > http://www.mylegalcareer.com.au/content.php/jobresults.html? form_sear...<br /> > mployerid=&form_search_employer_label=&form_search_locality= &form_search_<br /> > state=&form_search_employertype%5B%5D=&form_search_jobtype%5 B%5D=&form_se<br /> > arch_practice%5B%5D=&form_search_jobcategory%5B%5D=&form_sub mit_x=24&form<br /> > _submit_y=11&form_submit=Submit&rss=1<br /> <snip><br /> > Thanks in advance for any help you can give me... it's been a fun<br /> > challenge to even get to this point.<br /> <br /> IANAL...<br /> <br /> You don't say what's not working.<br /> <br /> Depending on the config of your PHP install, your code might niot be<br /> able to read directly from a web page. You can test this with:<br /> <br /> <?php<br /> <br /> print file('http://.....');<br /> <br /> ?><br /> <br /> If its a problem parsing the XML - there's a lot of code available off<br /> the shelf for handling RSS - I've used Magpie RSS and found it easy.<br /> <br /> C.</p> </article> <article> <h2>Re: Accessing a URL</h2><span>am 01.02.2008 13:35:21 von Captain Paralytic</span> <p>On 1 Feb, 09:08, SirFlibble <nospample...@garbagetodel.flibbled.com><br /> wrote:<br /> > Hi All,<br /> ><br /> > I'm not a programmer these days (been years since I have and since<br /> > become a lawyer... don't hate me) but a friend asked for a favour and<br /> > it's been a while since I cracked out even a basic piece of code so I<br /> > said ok.<br /> ><br /> > Anyhow, this script needs to read an RSS feed at the following extremely<br /> > long and annoying URL. From what I can work out )my friend didn't know<br /> > either) it's a PHP script that publishes the data as an RSS feed. The<br /> > URL is as follows.<br /> ><br /> > http://www.mylegalcareer.com.au/content.php/jobresults.html? form_sear...<br /> > mployerid=&form_search_employer_label=&form_search_locality= &form_search_<br /> > state=&form_search_employertype%5B%5D=&form_search_jobtype%5 B%5D=&form_se<br /> > arch_practice%5B%5D=&form_search_jobcategory%5B%5D=&form_sub mit_x=24&form<br /> > _submit_y=11&form_submit=Submit&rss=1<br /> ><br /> > Now I've written a small script which essentially reads the output from<br /> > that script (which I saved into a file for testing) and prints out the<br /> > <title> and <link> elements as a new webpage. The ultimate goal is the<br /> > actively feed off the RSS feed and present it in a nice HTML form in an<br /> > iframe (which will be used on several websites).<br /> ><br /> > So my question (after my long winded explanation) is how do I access<br /> > this data via it's URL? I can't seem to work it out.<br /> ><br /> > The code is as follows.<br /> ><br /> > <?php<br /> > if(!$xml=simplexml_load_file('test.xml')){<br /> > trigger_error('Error reading XML file',E_USER_ERROR);<br /> > }<br /> > for ($x = 0; $x<9; $x++) {<br /> > echo '<a href=' . $xml->channel[0]->item[$x]->link . '>'.<br /> > $xml->channel[0]->item[$x]->title . '</a><br>';<br /> > }<br /> > ?><br /> ><br /> > Thanks in advance for any help you can give me... it's been a fun<br /> > challenge to even get to this point.<br /> <br /> I thought lawyers had to be very careful with their grammar when<br /> writing legal documents so that they should not be misinterpreted?<br /> ("it's URL" should be "its URL")<br /> <br /> Anyway, you can use CURL or you may (as long as the server is<br /> configured to allow it - i.e. allow_url_fopen is enabled), be able to<br /> just put the URL into an fopen() call.</p> </article> <footer> <a href="/">Index</a> | <a href="/impressum.php">Impressum</a> | <a href="/datenschutz.php">Datenschutz</a> | <a href="https://www.xodox.de/">XODOX</a> </footer> </main> </body> </html>