tags:

views:

245

answers:

3

I've got a number of REST feeds I'd like to store in a MYSQL database, can anyone suggest a solution for this? Something PHP related appreciated....

A: 

To my knowledge there is no such thing as a REST feed. There are RSS feeds and Atom feeds, so I will assume you are talking about one of those.

Both are based on XML so I suggest you find an XML parser for PHP and do an HTTP request to get the feed contents, parse the XML into a DOM and then copy the DOM data into MYSQL!

I'm not sure how to be more precise.

Are you looking for someone to write the code?

Darrel Miller
A: 

It's not PHP related, but PERL has both a REST interface and a DBI interface (for interfacing with MYSQL).

http://search.cpan.org/~autrijus/WWW-REST-0.01/lib/WWW/REST.pm

There are many other REST interfaces for Google, Twitter, etc. Just search CPAN modules at search.cpan.org

Scott Lundberg
A: 

Ok, I'm assuming you are talking about "RSS" feeds. Here's a great opensource library that makes it easy -- http://simplepie.org/ . Point it at an RSS or Atom feed, it will give you back PHP arrays and objects. From there you can interpret them and save them any way you want.

Depending on what you actually want to do with the database, you could use RSS as an XML clob format. Not fast, but easy. Again, it totally depends on what you want to do with the database.

Vineel Shah