diff options
| author | 2025-12-17 14:43:26 +0000 | |
|---|---|---|
| committer | 2025-12-17 14:43:26 +0000 | |
| commit | eea38de00bb8c7bef0d4056fed80c10bf367aa64 (patch) | |
| tree | 6bc62b9702bc4eb613a5459723226461a4b772ac | |
| parent | runin: hard-fail if not given params (diff) | |
| signature | ||
wikibot/inthemedia: first 20, made it as variable
| -rw-r--r-- | wikibot/inthemedia.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wikibot/inthemedia.py b/wikibot/inthemedia.py index aa9e0cc..d5a14f9 100644 --- a/wikibot/inthemedia.py +++ b/wikibot/inthemedia.py @@ -1,12 +1,14 @@ import pywikibot +firstXentries = 20 + def main(): site = pywikibot.Site('en', 'ArchiveTeam') # Retrieve full "In The Media" page mediaPage = pywikibot.Page(site, 'In The Media') - # Parse contents and extract first 10 entries + # Parse contents and extract first n entries entries = [] for line in mediaPage.text.split('\n'): if not line: @@ -15,7 +17,7 @@ def main(): entries.append([line]) elif line[0] == ':': entries[-1].append(line) - topEntries = entries[:10] + topEntries = entries[:firstXentries] # Construct contents of "Main Page/In The Media" contents = [] |
