mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 19:06:49 -04:00
Flesh out OPDS generation backend to be more robust and to support generic Atom feeds
This commit is contained in:
parent
35188195f1
commit
f6df03cfca
23 changed files with 1549 additions and 267 deletions
20
lib/RssFeed.php
Normal file
20
lib/RssFeed.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?
|
||||
class RssFeed extends Feed{
|
||||
public $Description;
|
||||
|
||||
public function __construct(string $url, string $title, string $path, string $description, array $entries){
|
||||
parent::__construct($url, $title, $path, $entries);
|
||||
$this->Description = $description;
|
||||
$this->Stylesheet = '/rss/style';
|
||||
}
|
||||
|
||||
protected function GetXmlString(): string{
|
||||
if($this->XmlString === null){
|
||||
$feed = Template::RssFeed(['url' => $this->Url, 'description' => $this->Description, 'title' => $this->Title, 'entries' => $this->Entries, 'updatedTimestamp' => (new DateTime())->format('r')]);
|
||||
|
||||
$this->XmlString = $this->CleanXmlString($feed);
|
||||
}
|
||||
|
||||
return $this->XmlString;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue