I’ve been asked a number of times how I built the Headlines feed on EverythingNY and I thought that since I’ve benefited from other people’s code quite a bit over the years I should give back a little with my own. Basically, I’ve developed a bunch of PHP scripts that import RSS feeds into a MySQL database, then use the MTSQL plugin to pull the data into my MT pages.
When I first had the idea of displaying headline feeds from NY-centric bloggers on EverythingNY I thought the MTRSS plugin would be the way to go. I downloaded it and was able to quickly get a bunch of Gawker feeds onto my site like so:Snarky Headline 1
Snarky Headline 2
However, when I then added a second RSS feed from Gothamist it looked like this:Snarky Headline 1
Snarky Headline 2
Happy Headline 1
Happy Headline 2
Which was not what I wanted at all. After (way to much) fiddling with MTRSS I realized that the plugin was simply not going to support integrating multiple feeds into a unified presentation. In addition, it does not add feeds to a database so there was no opportunity for archiving.
I decided to write my own code for importing RSS feeds into a MySQL database. Since I am not a coder, the code…is kinda weak. But it works. Download it here:
Editors Note: The download has been removed as this code is woefully out of date.
RSSToMySQL.tar [link doesn’t work]
Since the spidering and database storage of the RSS entries are not specifically related to MT, I wrote my application in PHP with no direct connection to the MT code. This might have had something to do with my lack of perl knowledge as well. The code is not an MT plugin and does not have to be used with MT at all.
If you choose to use it within MT, you’ll need the MTSQL plugin. I’ve written a README file which includes sample MTSQL code used on EverythingNY.
Let me know what you think.