Skip to content

Keep the full page summaries in the featured and on-this-day feeds#6

Open
tamnd wants to merge 1 commit into
mainfrom
feeds-lossless
Open

Keep the full page summaries in the featured and on-this-day feeds#6
tamnd wants to merge 1 commit into
mainfrom
feeds-lossless

Conversation

@tamnd

@tamnd tamnd commented Jun 13, 2026

Copy link
Copy Markdown
Owner

What

The featured feed kept only a few fields per item:

  • The featured article dropped its thumbnail, original image, mobile URLs, and wikibase item.
  • The most-read list dropped its per-day view_history.
  • The picture of the day dropped its license, credit, artist, and file page.
  • The in-the-news links dropped the article summaries they point at.
  • The on-this-day highlights dropped their linked pages entirely.
  • The onthisday command kept only page titles, not the page summaries.

This makes both feeds lossless.

Changes

  • The feed types mirror the REST response, so feed/featured and feed/onthisday decode as-is.
  • FeedArticle is a full page summary (titles, namespace, thumbnail, original image, extract and extract_html, desktop and mobile content URLs, coordinates) plus the feed-only views, rank, and view_history.
  • FeedImage keeps the picture of the day's thumbnail, original image, file page, artist, credit, license, and description.
  • News links and on-this-day pages are full summaries.
  • Table and digest output unchanged: URL, StoryText, TextPlain, and PageTitles helpers render the same compact view.

Before / after

A live wiki featured 2020-07-20 -o json now reports 20 fields on the TFA (was a handful), view_history on each most-read article, 9 keys on the picture of the day, and full page summaries under each on-this-day entry. Before, the same fields were absent.

Tests

  • New TestFeaturedDecodePreservesFullStructure asserts the TFA media and mobile URLs, most-read view history, picture-of-the-day license and credit, in-the-news link summaries, and on-this-day linked-page summaries all survive the decode, and the helper accessors still render the digest.
  • go build, go vet, go test ./..., and golangci-lint run all clean.

The featured feed kept a handful of fields per item and threw the rest
away: the TFA lost its thumbnail, mobile URLs and wikibase item; the
most-read list lost its per-day view history; the picture of the day lost
its license, credit and artist; the in-the-news links lost the article
summaries they point at; and the on-this-day highlights dropped their
linked pages entirely. The on-this-day command kept only page titles.

The feed types now mirror the REST response, so the whole thing decodes
as-is. FeedArticle is a full page summary (titles, namespace, thumbnail,
original image, extract and extract_html, content URLs for desktop and
mobile, coordinates) plus the feed-only view counters and view history.
FeedImage keeps the picture of the day's thumbnail, original image, file
page, artist, credit, license and description. News links and on-this-day
pages are full summaries too.

Table and digest output are unchanged: helper methods (URL, StoryText,
TextPlain, PageTitles) render the same compact view as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant