Skip to content

Add pageviews count to MediaWikiPage.preview property#150

Merged
barrust merged 2 commits intobarrust:masterfrom
JBocage:pageviews-count
Jan 20, 2025
Merged

Add pageviews count to MediaWikiPage.preview property#150
barrust merged 2 commits intobarrust:masterfrom
JBocage:pageviews-count

Conversation

@JBocage
Copy link
Contributor

@JBocage JBocage commented Jan 17, 2025

This pull request adds data related to the pageviews count to the MediaWikiPage.preview property.

Below lies an example of the resultig content for the property

{'pageid': 8579940,
 'ns': 0,
 'title': 'Jules Perahim',
 'contentmodel': 'wikitext',
 'pagelanguage': 'de',
 'pagelanguagehtmlcode': 'de',
 'pagelanguagedir': 'ltr',
 'touched': '2024-12-04T12:56:00Z',
 'lastrevid': 232789413,
 'length': 5845,
 'extract': 'Jules Perahim, eigentlich Iuliş Blumenfeld, (* 24. Mai 1914 in Bukarest; † 2. März 2008 in Paris) war ein rumänischer Maler des Surrealismus und des sozialistischen Realismus.\n\n\n== Leben ==\nJules Perahim wurde als Iuliş Blumenfeld in eine jüdische Familie geboren. Er lernte bei den rumänischen Avantgardisten Nicolae Vermont und Costin Petrescu und zeichnete  schon mit siebzehn Jahren für die surrealistische Zeitschrift Unu.',
 'thumbnail': {'source': 'https://upload.wikimedia.org/wikipedia/commons/7/7a/600full-jules-perahim.jpg',
  'width': 200,
  'height': 262},
 'original': {'source': 'https://upload.wikimedia.org/wikipedia/commons/7/7a/600full-jules-perahim.jpg',
  'width': 200,
  'height': 262},
 'revisions': [{'revid': 232789413,
   'parentid': 232009839,
   'timestamp': '2023-04-13T21:25:10Z'}],
 'terms': {'description': ['rumänischer Maler des Surrealismus und des sozialistischen Realismus']},
 'pageviews': {'2024-11-18': None,
  '2024-11-19': 0,
  '2024-11-20': 0,
  '2024-11-21': 0,
  '2024-11-22': 0,
  '2024-11-23': None,
  '2024-11-24': None,
  '2024-11-25': 1,
  '2024-11-26': 1,
  '2024-11-27': None,
  '2024-11-28': None,
  '2024-11-29': 3,
  '2024-11-30': 0,
  '2024-12-01': 1,
  '2024-12-02': 0,
  ...
}}

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.19%. Comparing base (2343014) to head (d4b8867).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #150   +/-   ##
=======================================
  Coverage   94.19%   94.19%           
=======================================
  Files           6        6           
  Lines        1240     1240           
=======================================
  Hits         1168     1168           
  Misses         72       72           
Files with missing lines Coverage Δ
mediawiki/mediawikipage.py 94.42% <ø> (ø)

@barrust barrust merged commit 7d2e2ed into barrust:master Jan 20, 2025
8 checks passed
@barrust
Copy link
Owner

barrust commented Jan 20, 2025

Thank you! This looks great!

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.

3 participants