View Full Version : Rss

11-04-2006, 02:55 PM

Does anyone know if it is possible to get data from an rss feed and "put" it into a MySQL database??


11-04-2006, 07:38 PM
I have RSS feeds on my site that read a MySQL database and display the feeds, so I don't know why you couldn't do the reserve and store the data rather than read it.

Are you talking about scraping feed data off another site or what? You need to supply some details as to where the feed data will be coming from.

11-04-2006, 09:19 PM
Magpie RSS allows you to provide a URL, and be returned an object representing the RSS feed.
You can iterate over the result, and insert into the database, something like:

$rss = fetch_rss('http://www.google.com/news.rss');
foreach($rss->items as $item) {
$query='INSERT INTO news (headline,content,date) VALUES ('
mysql_query($query) or die($query.mysql_error());

Magpie instructions: