extract items from rss feed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gth759k
Forum Commoner
Posts: 76
Joined: Mon Jun 15, 2009 3:04 am

extract items from rss feed

Post by gth759k »

I'm trying to build a simple rss feed reader, and I had a script that would generate a list of all the links in an individual rss feed, but I seem to have lost it. What I'm looking for is a way to return an array of the <link></link> tags from an rss feed. For instance ... given a link to http://rss.cnn.com/rss/cnn_topstories I'd like to return a array ...

$links = array(
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html,
http://rss.cnn.com/~r/rss/cnn_topstorie ... index.html
);

and it would also be nice if I could return another array of the corresponding titles. Any help would be appreciated. Thanks.
Post Reply