diff --git a/config/apache/standardebooks.org.conf b/config/apache/standardebooks.org.conf index 770f65d5..5ea45687 100644 --- a/config/apache/standardebooks.org.conf +++ b/config/apache/standardebooks.org.conf @@ -250,7 +250,7 @@ Define webroot /standardebooks.org/web # If we ask for /opds/all?query=xyz, rewrite that to the search page. RewriteCond %{QUERY_STRING} ^query= - RewriteRule ^/feeds/opds/all.xml$ /feeds/opds/search.php [QSA] + RewriteRule ^/feeds/(opds|atom|rss)/all.xml$ /feeds/$1/search.php [QSA] # Rewrite old links to feeds RewriteRule ^/(opds|rss|atom)(.*)$ /feeds/$1$2 [R=301,L] diff --git a/config/apache/standardebooks.test.conf b/config/apache/standardebooks.test.conf index beb58612..4eb76e9b 100644 --- a/config/apache/standardebooks.test.conf +++ b/config/apache/standardebooks.test.conf @@ -249,7 +249,7 @@ Define webroot /standardebooks.org/web # If we ask for /opds/all?query=xyz, rewrite that to the search page. RewriteCond %{QUERY_STRING} ^query= - RewriteRule ^/feeds/opds/all.xml$ /feeds/opds/search.php [QSA] + RewriteRule ^/feeds/(opds|atom|rss)/all.xml$ /feeds/$1/search.php [QSA] # Rewrite old links to feeds RewriteRule ^/(opds|rss|atom)(.*)$ /feeds/$1$2 [R=301,L] diff --git a/scripts/generate-feeds b/scripts/generate-feeds index 68e9fad5..100315b9 100755 --- a/scripts/generate-feeds +++ b/scripts/generate-feeds @@ -84,7 +84,7 @@ $now = new DateTime(); // Create OPDS feeds $opdsRootEntries = [ new OpdsNavigationEntry( - 'Newest ' . number_format($ebooksPerNewestEbooksFeed) . ' Standard Ebooks', + 'Newest Standard Ebooks', 'The ' . number_format($ebooksPerNewestEbooksFeed) . ' latest Standard Ebooks, most-recently-released first.', '/feeds/opds/new-releases', $now, @@ -133,7 +133,7 @@ $allFeed = new OpdsAcquisitionFeed('All Standard Ebooks', 'All Standard Ebooks, SaveFeed($allFeed, $force, $now); // Create the 'newest' feed -$newestFeed = new OpdsAcquisitionFeed('Newest ' . number_format($ebooksPerNewestEbooksFeed) . ' Standard Ebooks', 'The ' . number_format($ebooksPerNewestEbooksFeed) . ' latest Standard Ebooks, most-recently-released first.', '/feeds/opds/new-releases', WEB_ROOT . '/feeds/opds/new-releases.xml', $newestEbooks, $opdsRoot); +$newestFeed = new OpdsAcquisitionFeed('Newest Standard Ebooks', 'The ' . number_format($ebooksPerNewestEbooksFeed) . ' latest Standard Ebooks, most-recently-released first.', '/feeds/opds/new-releases', WEB_ROOT . '/feeds/opds/new-releases.xml', $newestEbooks, $opdsRoot); SaveFeed($newestFeed, $force, $now); // Now create RSS feeds diff --git a/templates/AtomFeed.php b/templates/AtomFeed.php index 1580453f..3160873c 100644 --- a/templates/AtomFeed.php +++ b/templates/AtomFeed.php @@ -17,34 +17,8 @@ print("\n"); Standard Ebooks + - - Url ?> - <?= Formatter::ToPlainXmlText($entry->Title) ?> - Authors as $author){ ?> - - Name) ?> - AuthorsUrl) ?> - - - Timestamp->format('Y-m-d\TH:i:s\Z') ?> - ModifiedTimestamp->format('Y-m-d\TH:i:s\Z') ?> - Public domain in the United States. Users located outside of the United States must check their local laws before using this ebook. Original content released to the public domain via the Creative Commons CC0 1.0 Universal Public Domain Dedication. - Description) ?> - LongDescription) ?> - LocTags as $subject){ ?> - - - Tags as $subject){ ?> - - - - - EpubUrl)){ ?> - AdvancedEpubUrl)){ ?> - KepubUrl)){ ?> - Azw3Url)){ ?> - TextSinglePageUrl)){ ?> - + $entry]) ?> diff --git a/templates/AtomFeedEntry.php b/templates/AtomFeedEntry.php new file mode 100644 index 00000000..fcfacb0f --- /dev/null +++ b/templates/AtomFeedEntry.php @@ -0,0 +1,28 @@ + + Url ?> + <?= Formatter::ToPlainXmlText($entry->Title) ?> + Authors as $author){ ?> + + Name) ?> + AuthorsUrl) ?> + + + Timestamp->format('Y-m-d\TH:i:s\Z') ?> + ModifiedTimestamp->format('Y-m-d\TH:i:s\Z') ?> + Public domain in the United States. Users located outside of the United States must check their local laws before using this ebook. Original content released to the public domain via the Creative Commons CC0 1.0 Universal Public Domain Dedication. + Description) ?> + LongDescription) ?> + LocTags as $subject){ ?> + + + Tags as $subject){ ?> + + + + + EpubUrl)){ ?> + AdvancedEpubUrl)){ ?> + KepubUrl)){ ?> + Azw3Url)){ ?> + TextSinglePageUrl)){ ?> + diff --git a/templates/RssEntry.php b/templates/RssEntry.php new file mode 100644 index 00000000..5c5c4f22 --- /dev/null +++ b/templates/RssEntry.php @@ -0,0 +1,14 @@ + + <?= Formatter::ToPlainXmlText($entry->Title) ?>, by <?= Formatter::ToPlainXmlText(strip_tags($entry->AuthorsHtml)) ?> + Url) ?> + Description) ?> + Timestamp->format('r') ?> + Identifier)) ?> + Tags as $tag){ ?> + Name) ?> + + + EpubUrl !== null){ ?> + is allowed */ ?> + + diff --git a/templates/RssFeed.php b/templates/RssFeed.php index f3432e62..bba4075b 100644 --- a/templates/RssFeed.php +++ b/templates/RssFeed.php @@ -15,6 +15,7 @@ print("\n"); http://blogs.law.harvard.edu/tech/rss +