for RDFa metadata details. use Safe\DateTimeImmutable; use function Safe\preg_match; use function Safe\preg_replace; use function Safe\shuffle; $ebook = null; $transcriptionSources = []; $scanSources = []; $otherSources = []; $carousel = []; $carouselTag = null; $targetCarouselSize = 5; try{ $identifier = EBOOKS_IDENTIFIER_PREFIX . trim(str_replace('.', '', HttpInput::Str(GET, 'url-path') ?? ''), '/'); // Contains the portion of the URL (without query string) that comes after `https://standardebooks.org/ebooks/`. $ebook = Ebook::GetByIdentifier($identifier); // Divide our sources into transcriptions and scans. foreach($ebook->Sources as $source){ switch($source->Type){ case Enums\EbookSourceType::ProjectGutenberg: case Enums\EbookSourceType::ProjectGutenbergAustralia: case Enums\EbookSourceType::ProjectGutenbergCanada: case Enums\EbookSourceType::Wikisource: case Enums\EbookSourceType::FadedPage: $transcriptionSources[] = $source; break; case Enums\EbookSourceType::InternetArchive: case Enums\EbookSourceType::HathiTrust: case Enums\EbookSourceType::GoogleBooks: $scanSources[] = $source; break; case Enums\EbookSourceType::Other: $otherSources[] = $source; break; } } if(sizeof($ebook->Tags) > 0){ $carouselTag = $ebook->Tags[rand(0, sizeof($ebook->Tags) - 1)]; } $carousel = Ebook::GetAllByRelated($ebook, $targetCarouselSize, $carouselTag); } catch(Exceptions\EbookNotFoundException){ // Were we passed the author and a work but not the translator? // For example: // Instead of: . try{ $ebook = Ebook::GetByIdentifierStartingWith($identifier); // Found, redirect. http_response_code(Enums\HttpCode::MovedPermanently->value); header('Location: ' . $ebook->Url); exit(); } catch(Exceptions\EbookNotFoundException){ // Still not found, continue. } // Are we accessing a placeholder for a Public Domain Day book that is not yet released? if(array_key_exists($identifier, PD_DAY_EBOOKS)){ require('/standardebooks.org/web/www/ebooks/public-domain-day-placeholder.php'); exit(); } Template::Emit404(); } ?> strip_tags($ebook->TitleWithCreditsHtml) . ' - Free ebook download', 'ogType' => 'book', 'coverUrl' => $ebook->DistCoverUrl, 'highlight' => 'ebooks', 'description' => 'Free epub ebook download of the Standard Ebooks edition of ' . $ebook->Title . ': ' . $ebook->Description, 'canonicalUrl' => SITE_URL . $ebook->Url]) ?>
WikipediaUrl){ ?>

Title) ?>

Authors as $author){ ?> Name != 'Anonymous'){ ?>

Name) ?> NacoafUrl){ ?> WikipediaUrl){ ?>

HeroImage2xAvifUrl !== null){ ?>

Description

LongDescription ?>
HasDownloads){ ?>
GenerateContributorsRdfa() ?>

Read free

This ebook is thought to be free of copyright restrictions in the United States. It may still be under copyright in other countries. If you’re not located in the United States, you must check your local laws to verify that this ebook is free of copyright restrictions in the country you’re located in before accessing, downloading, or using it.

Download for ereaders

    EpubUrl !== null){ ?>
  • Compatible epub All devices and apps except Kindles and Kobos.

  • Azw3Url !== null){ ?>
  • azw3 Kindle devices and apps.KindleCoverUrl !== null){ ?> Also download the Kindle cover thumbnail to see the cover in your Kindle’s library. Despite what you’ve been told, Kindle does not natively support epub. You may also be interested in our Kindle FAQ. Also see our Kindle FAQ.

  • KepubUrl !== null){ ?>
  • kepub Kobo devices and apps. You may also be interested in our Kobo FAQ.

  • AdvancedEpubUrl !== null){ ?>
  • Advanced epub An advanced format that uses the latest technology not yet fully supported by most ereaders.

TextUrl !== null || $ebook->TextSinglePageUrl !== null){ ?>

Read online

    TextUrl !== null){ ?>
  • Start from the table of contents

  • TextSinglePageUrl !== null){ ?>
  • TextSinglePageByteCount >= EBOOK_SINGLE_PAGE_SIZE_WARNING){ ?> class="has-size"> Read on one pageTextSinglePageByteCount >= EBOOK_SINGLE_PAGE_SIZE_WARNING){ ?>TextSinglePageSizeFormatted ?>

A brief history of this ebook

    GitCommits as $commit){ ?>
  1. Message) ?>

GitHubUrl !== null){ ?>
GitHubUrl !== null || $ebook->WikipediaUrl !== null){ ?>

More details

0 || sizeof($scanSources) > 0 || sizeof($otherSources) > 0){ ?>

Sources

0){ ?>

Transcriptions

0){ ?>

Page scans

0){ ?>

Other sources

Improve this ebook

Anyone can contribute to make a Standard Ebook better for everyone!

To report typos, typography errors, or other corrections, see how to report errors.

GitHubUrl !== null){ ?>

If you’re comfortable with technology and want to contribute directly, check out this ebook’s GitHub repository and our contributors section.

You can also donate to Standard Ebooks to help fund continuing improvement of this and other ebooks.

0){ ?>