A simple RSS to SQL generator
Was looking for a simple way to put entries from an RSS feed into a database the other day, and didn't like what I found via a quick google. So, I put together a very short and to the point script using SimpleXML and the php mysql driver:
<?php
$ch = curl_init($argv[1]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$rss = new SimpleXMLElement(curl_exec($ch));
// fill these next two rows in!
$dbLink = mysql_connect('localhost', 'username', 'xxxxx');
mysql_select_db('xxxxx', $dbLink);
foreach($rss->channel->item as $blah) {
Syndicated 2007-08-20 06:03:12 from papasian.org - lifehacking