User:AllyUnion/Bot draft work

From Wikipedia, the free encyclopedia

Category Archival Bot[edit]

  1. import wikipedia, config
  2. import datetime
  3. Get today's UTC date
  4. category = 'WikiProject'
  5. list = catlib.CatLink(site, category).articles() - will get all articles in the category as a list
  6. for item in list:
    • PageLink.getVersionHistory() for each item
    • Parse the data for the date
    • Build string data from info into datetime object
      1. Compare date, if project page: has been edited in the last 6 months?
      2. Compare date, if project's talk page: has been edited in the last 2 months?
      3. Is the page not: 'Wikipedia:WikiProject' and its talk page?
      4. Is the page not: 'Template:WikiProject' and its talk page?
      5. Is the page not a redirect?
    • If all yes, remove Category:WikiProjects'''(*).
      Where (*) is any number of characters including zero. May require perl for this.
    • Mark page with Template:Inactive.