diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-05 11:30:27 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-05 11:30:38 +0100 |
commit | 95530f62513a82c385d9378b4a59da57d74092d9 (patch) | |
tree | a4d17994548999b42e99371f381da8c256ee39bf /3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php | |
parent | 57163ad25a7dc63abd8aff8663c185ddad398466 (diff) |
update picofeed, add max size setting, fix #642
Diffstat (limited to '3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php')
-rw-r--r-- | 3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php b/3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php new file mode 100644 index 000000000..2e763fb45 --- /dev/null +++ b/3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php @@ -0,0 +1,77 @@ +<?php + +namespace PicoFeed\Parser; + +use SimpleXMLElement; + +/** + * RSS 1.0 parser + * + * @author Frederic Guillot + * @package Parser + */ +class Rss10 extends Rss20 +{ + /** + * Get the path to the items XML tree + * + * @access public + * @param SimpleXMLElement $xml Feed xml + * @return SimpleXMLElement + */ + public function getItemsTree(SimpleXMLElement $xml) + { + return $xml->item; + } + + /** + * Find the feed date + * + * @access public + * @param SimpleXMLElement $xml Feed xml + * @param \PicoFeed\Parser\Feed $feed Feed object + */ + public function findFeedDate(SimpleXMLElement $xml, Feed $feed) + { + $feed->date = $this->parseDate(XmlParser::getNamespaceValue($xml->channel, $this->namespaces, 'date')); + } + + /** + * Find the feed language + * + * @access public + * @param SimpleXMLElement $xml Feed xml + * @param \PicoFeed\Parser\Feed $feed Feed object + */ + public function findFeedLanguage(SimpleXMLElement $xml, Feed $feed) + { + $feed->language = XmlParser::getNamespaceValue($xml->channel, $this->namespaces, 'language'); + } + + /** + * Genereate the item id + * + * @access public + * @param SimpleXMLElement $entry Feed item + * @param \PicoFeed\Parser\Item $item Item object + * @param \PicoFeed\Parser\Feed $feed Feed object + */ + public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed) + { + $item->id = $this->generateId( + $item->getTitle(), $item->getUrl(), $item->getContent() + ); + } + + /** + * Find the item enclosure + * + * @access public + * @param SimpleXMLElement $entry Feed item + * @param \PicoFeed\Parser\Item $item Item object + * @param \PicoFeed\Parser\Feed $feed Feed object + */ + public function findItemEnclosure(SimpleXMLElement $entry, Item $item, Feed $feed) + { + } +} |