Permalink
Browse files

Add oldrevredirs.py

  • Loading branch information...
Anton Facenapalm Anton Facenapalm
Anton Facenapalm authored and Anton Facenapalm committed Jul 9, 2017
1 parent 95f8ac7 commit 61ab4f5e88b64a982267c58c0aafc2148850f6dd
Showing with 24 additions and 0 deletions.
  1. +1 −0 crontab
  2. +23 −0 oldrevredirs.py
View
@@ -38,6 +38,7 @@
0 1 * * * jsub -N checkwiki -quiet -o /dev/null -e /dev/null python3 $HOME/cwtrigger.py $HOME/markers $HOME/data/checkwiki.txt
# weekly
0 12 * * 0 jsub -N validation-plots -quiet -o /dev/null -e /dev/null python3 $HOME/validplots.py $HOME/data/validation.tsv $HOME/data/
0 12 * * 0 jsub -N oldrev_redirects -quiet -o /dev/null -e /dev/null python3 $HOME/oldrevredirs.py
0 0 * * 2 jsub -N tow -quiet -o /dev/null -e /dev/null python3 $HOME/tow.py
0 0 * * 5 jsub -N sort-unrev-files -quiet -o /dev/null -e /dev/null python3 $HOME/sort_unrev_files.py
0 0 * * 6 jsub -N afi -quiet -o /dev/null -e /dev/null python3 $HOME/afi.py
View
@@ -0,0 +1,23 @@
"""Extract list of oldreviewed redirects."""
import pywikibot
import validstats
TO_FILE = False
def main():
"""Main script function."""
site = pywikibot.Site()
titles = sorted(validstats.get_orlist(site, "*", "redirects"))
text = "\n".join(["* [{{{{fullurl:{title}|action=history}}}} {title}]".format(title=title) for title in titles])
if TO_FILE:
output = open("output.txt", "w", encoding="utf-8")
output.write(text)
output.close()
else:
page = pywikibot.Page(site, "Участник:ØM/Перенаправления")
page.text = text
page.save("Обновление списка.")
if __name__ == "__main__":
main()

0 comments on commit 61ab4f5

Please sign in to comment.