Add support for RSS 0.91 and 0.92
This commit is contained in:
parent
2925001dcb
commit
b3ea83fe96
14
miniflux/vendor/PicoFeed/Parser.php
vendored
14
miniflux/vendor/PicoFeed/Parser.php
vendored
@ -134,7 +134,15 @@ class Rss20 extends Parser
|
||||
$this->url = (string) $xml->channel->link;
|
||||
$this->id = $this->url;
|
||||
$this->updated = isset($xml->channel->pubDate) ? (string) $xml->channel->pubDate : (string) $xml->channel->lastBuildDate;
|
||||
|
||||
if ($this->updated) {
|
||||
|
||||
$this->updated = strtotime($this->updated);
|
||||
}
|
||||
else {
|
||||
|
||||
$this->updated = time();
|
||||
}
|
||||
|
||||
foreach ($xml->channel->item as $entry) {
|
||||
|
||||
@ -273,3 +281,9 @@ class Rss10 extends Parser
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Rss92 extends Rss20 {}
|
||||
|
||||
|
||||
class Rss91 extends Rss20 {}
|
||||
|
8
miniflux/vendor/PicoFeed/Reader.php
vendored
8
miniflux/vendor/PicoFeed/Reader.php
vendored
@ -75,6 +75,14 @@ class Reader
|
||||
|
||||
return new Rss20($this->content);
|
||||
}
|
||||
else if (strpos($first_tag, '<rss ') !== false && strpos($first_tag, 'version="0.92"') !== false) {
|
||||
|
||||
return new Rss92($this->content);
|
||||
}
|
||||
else if (strpos($first_tag, '<rss ') !== false && strpos($first_tag, 'version="0.91"') !== false) {
|
||||
|
||||
return new Rss91($this->content);
|
||||
}
|
||||
else if (strpos($first_tag, '<rdf:') !== false && strpos($first_tag, 'xmlns="http://purl.org/rss/1.0/"') !== false) {
|
||||
|
||||
return new Rss10($this->content);
|
||||
|
Loading…
Reference in New Issue
Block a user