15 Jun 2008 bugg   » (Journeyer)

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) {

read more

Syndicated 2007-08-20 06:03:12 from papasian.org - lifehacking

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!