Keep the full page summaries in the featured and on-this-day feeds#6
Open
tamnd wants to merge 1 commit into
Open
Keep the full page summaries in the featured and on-this-day feeds#6tamnd wants to merge 1 commit into
tamnd wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The featured feed kept only a few fields per item:
view_history.onthisdaycommand kept only page titles, not the page summaries.This makes both feeds lossless.
Changes
feed/featuredandfeed/onthisdaydecode as-is.FeedArticleis a full page summary (titles, namespace, thumbnail, original image, extract andextract_html, desktop and mobile content URLs, coordinates) plus the feed-onlyviews,rank, andview_history.FeedImagekeeps the picture of the day's thumbnail, original image, file page, artist, credit, license, and description.URL,StoryText,TextPlain, andPageTitleshelpers render the same compact view.Before / after
A live
wiki featured 2020-07-20 -o jsonnow reports 20 fields on the TFA (was a handful),view_historyon 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
TestFeaturedDecodePreservesFullStructureasserts 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 ./..., andgolangci-lint runall clean.