Showing posts with label rss php. Show all posts
Showing posts with label rss php. Show all posts

Thursday, April 21

DOM to Parse XML and HTML

As you have seen we can easily use DOM to manipulate XML and HTML and it's really very very simple.

You use the $node->getElementsByTagName('title')->item(0)->nodeValue , for instance the <title> tag, you can grab the title.

If you have many nodes, you do a for each loop. Say you have 3 list items in <UL>, you can declare $listitems = $doc->getElementsByTagName('li').
Now we have a group of list items, all we have to do now is loop through them and get our stuff. for each ($listitems as $listitem){ $listitem_output = $listitem->item(0)->nodeValue; echo $listitem_output;}
Isn't that great?

Feel free to checkout some posts on how to get attributes using the getAttribute property from DOM, very exciting stuff this is.

Thursday, July 16

RSS PHP Parsers: Your own RSS Aggregator

RSS PHP Parsers basically allows you to use PHP and the power of RSS to create your own Aggregator. Meaning you can now have an automated website or blog with RSS feeding into it, essentially your own RSS Aggregator.

RSS Parsers make it simple to use the RSS feeds as they deal with RSS parsing issues.
Here we have collected the best free RSS to PHP parsers available.

MagpieRSS
Easy to use RSS PHP parser.
RSS 1.0, 2.0, Atom.

SimplePie
SimplePie is a library of PHP code which parses RSS feeds.

lastRSS
A powerful PHP class for parsing RSS feeds.
All RSS versions supported.

Zend_Feed
Another easy to use RSS parser.
 

Template by James William at 2600 Degrees