| Status | Draft |
|---|---|
| Todo | Proof read |
The Feed helper assist in the parsing of remote RSS feeds.
'parse' parses a RSS feed and returns the parsed feed as an array.
$feed = "feed.xml"; print Kohana::debug(feed::parse($feed));
Use the code above on this RSS feed:
<?xml version="1.0" encoding="UTF-8"?> <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"> <channel> <item> <title>Some feed item</title> <link>http://www.example.com/article34</link> <description>This article is really cool!</description> <author>Aart-Jan Boor</author> <pubDate>Sat, 08 Dec 2007 13:28:11 GMT</pubDate> </item> <item> <title>Some feed item2</title> <link>http://www.example.com/article546</link> <description>This article is really cool too!</description> <author>Aart-Jan Boor</author> <pubDate>Sat, 08 Dec 2007 12:57:56 GMT</pubDate> </item> <item> <title>Some feed item3</title> <link>http://www.example.com/article4523</link> <description>This article is the best!</description> <author>Aart-Jan Boor</author> <pubDate>Sat, 08 Dec 2007 12:39:42 GMT</pubDate> </item> </channel> </rss>
It will result in HTML as:
Array
(
[0] => Array
(
[title] => Some feed item
[link] => http://www.example.com/article34
[description] => This article is really cool!
[author] => Aart-Jan Boor
[pubDate] => Sat, 08 Dec 2007 13:28:11 GMT
)
[1] => Array
(
[title] => Some feed item2
[link] => http://www.example.com/article546
[description] => This article is really cool too!
[author] => Aart-Jan Boor
[pubDate] => Sat, 08 Dec 2007 12:57:56 GMT
)
[2] => Array
(
[title] => Some feed item3
[link] => http://www.example.com/article4523
[description] => This article is the best!
[author] => Aart-Jan Boor
[pubDate] => Sat, 08 Dec 2007 12:39:42 GMT
)
)