
Checking Feed Health With a Daily Script and Clear Alerts
A feed health check that tests the fetch, status, content type, well-formedness, item count and freshness, run on eight scenarios with its output.
Tag
10 posts

A feed health check that tests the fetch, status, content type, well-formedness, item count and freshness, run on eight scenarios with its output.

A feed with a raw ampersand, a missing id, a bad date, a duplicate id and an extra element: repair what is safe, quarantine the rest, report each reject.

Fetch a feed only when it changed: ETag and Last-Modified headers, a 304 response, a state table, and what to do when the server ignores them.

A gzip file, gzip transfer encoding and unlabeled gzip behave differently in requests and urllib. Sniff the bytes, stream 36.6 MB at 21 MB, and guard bombs.

Check a Merchant-style product feed before loading it: required fields, price format, availability values, GTIN check digits, duplicate ids and links.

Call a SOAP service from Python with zeep: load the WSDL, call an operation, get typed results, handle a Fault, see the request envelope,.

Pull records out of a SOAP response with lxml: mixed-namespace children, xsi:nil, empty versus absent, repeated nodes and exact decimals.

Read a real public QuakeML feed from the USGS: two namespaces, nested value elements, depth in meters, magnitude types, and checks that catch a wrong unit.

Generate sitemap files from a PostgreSQL table with a streaming writer: 117,002 URLs in 0.6 seconds, split at 50,000 per file, with an index and validation.

Load an Atom feed into PostgreSQL by entry id with insert or update, read links, categories and html content correctly, and compare lxml with feedparser.