Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-04-2006, 01:55 PM   PM User | #1
alex57
Regular Coder

 
Join Date: Sep 2006
Posts: 216
Thanks: 9
Thanked 0 Times in 0 Posts
alex57 has a little shameless behaviour in the past
Rss

Hello,

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

Thanks
alex57 is offline   Reply With Quote
Old 11-04-2006, 06:38 PM   PM User | #2
vinyl-junkie
$object->toCD-R(LP);


 
vinyl-junkie's Avatar
 
Join Date: Jun 2003
Posts: 3,054
Thanks: 2
Thanked 22 Times in 22 Posts
vinyl-junkie is on a distinguished road
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.
__________________
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
SNAP to it!
vinyl-junkie is offline   Reply With Quote
Old 11-04-2006, 08:19 PM   PM User | #3
GJay
Senior Coder

 
Join Date: Sep 2005
Posts: 1,791
Thanks: 5
Thanked 36 Times in 35 Posts
GJay is on a distinguished road
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:
PHP Code:
$rss fetch_rss('http://www.google.com/news.rss');
foreach(
$rss->items as $item) {
$query='INSERT INTO news (headline,content,date) VALUES ('
  
.mysql_real_escape_string($item['title']).','
  
.mysql_real_escape_string($item['body']).','
  
.mysql_real_escape_string($item['pubdate'])
.
')';
mysql_query($query) or die($query.mysql_error());

Magpie instructions:
http://magpierss.sourceforge.net/
GJay is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:43 PM.


Advertisement
Log in to turn off these ads.