miniflux-legacy/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php

78 lines
2.0 KiB
PHP
Raw Normal View History

2013-04-05 05:34:07 +02:00
<?php
namespace PicoFeed\Parser;
2014-05-20 20:20:27 +02:00
use SimpleXMLElement;
/**
* RSS 1.0 parser
*
* @author Frederic Guillot
* @package Parser
2014-05-20 20:20:27 +02:00
*/
class Rss10 extends Rss20
2013-04-05 05:34:07 +02:00
{
2014-05-20 20:20:27 +02:00
/**
* Get the path to the items XML tree
*
* @access public
* @param SimpleXMLElement $xml Feed xml
* @return SimpleXMLElement
*/
public function getItemsTree(SimpleXMLElement $xml)
2013-04-05 05:34:07 +02:00
{
2014-05-20 20:20:27 +02:00
return $xml->item;
}
2013-04-05 05:34:07 +02:00
2014-05-20 20:20:27 +02:00
/**
* Find the feed date
*
* @access public
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
2014-05-20 20:20:27 +02:00
*/
public function findFeedDate(SimpleXMLElement $xml, Feed $feed)
{
2014-10-19 20:42:31 +02:00
$feed->date = $this->parseDate(XmlParser::getNamespaceValue($xml->channel, $this->namespaces, 'date'));
2014-05-20 20:20:27 +02:00
}
2013-04-05 05:34:07 +02:00
2014-05-20 20:20:27 +02:00
/**
* Find the feed language
*
* @access public
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
2014-05-20 20:20:27 +02:00
*/
public function findFeedLanguage(SimpleXMLElement $xml, Feed $feed)
{
2014-10-19 20:42:31 +02:00
$feed->language = XmlParser::getNamespaceValue($xml->channel, $this->namespaces, 'language');
2014-05-20 20:20:27 +02:00
}
2013-04-05 05:34:07 +02:00
2014-05-20 20:20:27 +02:00
/**
* 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
2014-05-20 20:20:27 +02:00
*/
public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed)
{
$item->id = $this->generateId(
$item->getTitle(), $item->getUrl(), $item->getContent()
);
2014-05-20 20:20:27 +02:00
}
2013-08-30 01:34:11 +02:00
2014-05-20 20:20:27 +02:00
/**
* 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
2014-05-20 20:20:27 +02:00
*/
public function findItemEnclosure(SimpleXMLElement $entry, Item $item, Feed $feed)
{
2013-04-05 05:34:07 +02:00
}
2014-05-20 20:20:27 +02:00
}