NAME
harvest
SYNOPSIS
antenna harvest [COLLECTION_NAME]
DESCRIPTION
Retrieves RSS, Atom and JSON feed content for all collections (or only COLLECTION_NAME) and stores harvested items in each collection’s SQLite3 database. Run generate afterwards to rebuild the HTML pages.
A link in a collection’s Markdown file may be the feed itself or the address of a site. For a site, harvest finds the feed, trying in this order: the address itself; an rss outline (xmlUrl) in a table of contents (.well-known/toc.opml); a link tag in an HTML page that names a feed; and up to eight common paths (feed, feed/, rss, rss.xml, feed.xml, atom.xml, index.xml, feeds/posts/default). The address it finds is remembered in the collection’s database, so later runs go straight to it and make no guesses. A site that has only a table of contents of pages and no feed cannot be collected: harvest says so for that link and carries on with the others. It never fetches the pages a table of contents lists.
Harvest does not read robots.txt: it fetches feeds that sites publish for subscription, and the guessed feed addresses are bounded (eight at most, once per listed address per run). Requests to one host are made one at a time with a pause between them, 500 ms unless the harvest setting in antenna.yaml says otherwise, and each carries the User-Agent so a site can see who is asking.
Each attempt to fetch a listed feed is recorded in the collection’s database (table harvest_log): when, the HTTP status of the answer (none when the address did not answer), and the error when it failed. At the end of a collection’s harvest, a feed that keeps failing gets one warning on standard error: every attempt in the last 7 days failed, and there were at least 3 of them. It names the status in words, for example “last status 404 Not Found” or “last status 503 Service Unavailable”. Any answer other than a feed counts as a failure, 429 and 503 included; one good answer inside the window clears the feed. The warning does not change the exit status, and nothing is skipped or removed automatically. The days, the attempts and how long log rows are kept (90 days) are the harvest settings failing_days, failing_attempts and log_days in antenna.yaml. See antennaApp DR-0038.
PARAMETERS
- COLLECTION_NAME
- (optional) harvest only this collection
EXIT STATUS
- 0
- every feed was harvested
- 2
- unknown option or extra argument
- 65
- a feed, table of contents or page could not be parsed, or a site has no feed to find
- 66
- the configuration or a collection file is missing
- 69
- a feed could not be reached or answered with an error
- 74
- reading a response failed part way
- 78
- the configuration is wrong, for example a harvest pause that is not a duration
When some feeds fail the others are still harvested, and harvest exits with the class of the first failure, after saying how many failed.
ALIASES
fetch
EXAMPLES
antenna harvest antenna harvest feeds/tech.md
A collection file may list a site and let harvest find its feed:
SEE ALSO
antenna help configuration (the harvest setting), antenna help markdown-web