Hi
I'm trying to find out how easy/hard it would be to read a RSS feed and then place the data in MySQL
the feed is here... http://www.highways.gov.uk/rssfeed/rss.xml
The terms state that if I want to use this feed then I need to cache the data every 5 minutes to my server, where I can then output it as often as I like [ to save their server ]
So, I was thinking if I made a table for all the values, and wrote a script that could read the RSS feed every 5 minutes via a CRON JOB I could Empty the current data in the table, read the feed then add the new data.
BUT ...
I also want to extract the LAT & LNG held in the <link>URL</link> tabs
<link>http://www.trafficengland.co.uk/map/browse.cgi?client=tcc&lat=52.512376&lon=-1.726174&scale=200000&icon=x¤tChk=checked</link>
RSS isn't something I've even got in to, so I'm scratching my head where to start here...
Any help on the reading of the feed and/or breaking it up in to its values [ITEMS], and also just the LAT & LNG in the LINK would be most welcome.
Example :
- <item>
<title>M42 Warwickshire | Northbound | Vehicle fire, 2 lanes closed</title>
<description>On the M42 northbound entry slip at junction J8 , there are currently delays of 20 mins due to a vehicle on fire closing two lanes. Normal traffic conditions expected from 7:45 pm.</description>
<author>Highways Agency (NTCC)</author>
<pubDate>Wed, 06 Jun 2007 17:41:45 GMT</pubDate>
<link>http://www.trafficengland.co.uk/map/browse.cgi?client=tcc&lat=52.512376&lon=-1.726174&scale=200000&icon=x¤tChk=checked</link>
<guid>U-07-0606-0162</guid>
</item>
Would generate...
$title="M42 Warwickshire | Northbound | Vehicle fire, 2 lanes closed";
$description="On the M42 northbound entry slip at junction J8 , there are currently delays of 20 mins due to a vehicle on fire closing two lanes. Normal traffic conditions expected from 7:45 pm";
$author="Highways Agency (NTCC)";
$pubDate="Wed, 06 Jun 2007 17:41:45 GMT";
$link="http://www.trafficengland.co.uk/map/browse.cgi?client=tcc&lat=52.512376&lon=-1.726174&scale=200000&icon=x¤tChk=checked";
$guid="U-07-0606-0162";
$LAT="{the lat in the $link URL}";
$LNG="{the lng in the $link URL}";
Any help on this would be welcome, there may be something already out there that does such a job, so I'm just aksing, if there is not, then maybe someone can point me to a good starting point where I can then write it myself.