Wikipedia:Bots/Requests for approval/TFA Protector Bot

This is an old revision of this page, as edited by 166.137.209.143 (talk) at 13:56, 15 May 2013 (Discussion). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Operator: Legoktm (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)

Time filed: 17:06, Thursday May 9, 2013 (UTC)

Automatic, Supervised, or Manual: Automatic

Programming language(s): Python

Source code available: here (incomplete)

Function overview: Move protects articles that are scheduled to appear on the main page as the TFA per current custom

Links to relevant discussions (where appropriate): Wikipedia:Bot_requests/Archive_54#Anyone_got_an_adminbot_looking_for_work.3F

Edit period(s): Daily, will run 5 minutes before midnight

Estimated number of pages affected: 1/day

Exclusion compliant (Yes/No): No

Already has a bot flag (Yes/No): No, will need bot+sysop

Function details:

  • Gets the TFA for the next day with Template:TFA title.
  • Checks the protection level:
    • If move=autoconfirmed: protect w/ move=sysop expiry=when off main page
    • If move=sysop: Check if expiry is long enough, if not: re-protect w/ move=sysop expiry=when off main page
    • If not move protected: Protect w/ move=sysop expiry=when off main page

I decided it was pointless to re-instate any move=autoconfirmed protection since non-autoconfirmed users can't move pages.

Discussion

@Bencherlite: Legoktm (talk) 17:06, 9 May 2013 (UTC)[reply]

  • As a TFA delegate, I think this is an excellent idea, not least because I suggested it! Move protection is generally put in place for the day of a featured article's appearance on the main page, because it prevents vandalism such as this taking place. However, it's quite easy for me to forget to do it at all, or set it to expire at the start of the day rather than at the end of the day. It would be very helpful to have an adminbot to do this limited task (and it would make my life, and that of current/future TFA delegates, slightly easier as a result). BencherliteTalk 18:40, 9 May 2013 (UTC)[reply]
  • I am hopeless at botcode but I can spot typos in edit summaries: "Upcomping"? I have also mentioned this BRFA at WT:TFAR since that's where all the kool kids hang out people with an interest in TFAs tend to hang out. BencherliteTalk 19:00, 9 May 2013 (UTC)[reply]
  • Agree that this is a great idea. It's logical and sensible and there's no real downside here so long as it operates properly. Thanks for the help, — Cirt (talk) 19:27, 9 May 2013 (UTC)[reply]
  • If we're having a bot do this, is it also worth having the bot fully protect all templates used in TFA? It's been less of a problem recently, but we used to get quite a bit of that sort of vandalism (e.g. penis appears floating on TFA, but editing that page will not remove it and someone has to check all unprotected/semi-protected transcluded templates). WJBscribe (talk) 22:34, 9 May 2013 (UTC)[reply]
    Alternatively, WP:FAP could be revived, cascade protected and the bot could transclude all the templates from TFA onto that page, instead of protecting each template. WJBscribe (talk) 22:51, 9 May 2013 (UTC)[reply]
    That sounds like a better idea to me. I think that we should stick to just move protection for this task, and look into using WP:FAP in another BRFA. Legoktm (talk) 04:21, 13 May 2013 (UTC)[reply]
  • I'm hopeless at python, and I still am not used to legoktm being highlighted blue now. but I don't see any issues with this bot.—cyberpower ChatOnline 03:17, 10 May 2013 (UTC)[reply]

I reviewed the code, and I have the following comments/questions:

  1. What will the bot do should the TFA title subtemplate not exist or contain the empty string for a particular day? I guess either pywikipedia will throw an exception at line 71 or you'll run into an undefined variable access at some point.
  2. I see the bot is supposed to run at 5 minutes before midnight. If this is somehow delayed, it looks like the bot will skip today and go protect tomorrow's FA instead.
  3. What happens if the listed FA title happens to be a redirect? Will it move-protect the page or the redirect? For that matter, what makes sense for it to do there? Off the top of my head, it seems that move-protecting the page and both move- and edit-protecting the redirect would make the most sense.
  4. I note the query you are performing will set the protections to just move protection, removing any other protection (e.g. edit protection). This is obviously not right. While Template:Bug exists, no one has worked on it yet.
  5. I wonder if the bot should try to restore the old move semi-protection after the page is off the main page.

Item #4 is a blocking problem. HTH. Anomie 12:32, 13 May 2013 (UTC)[reply]

Good bot idea. Needs some tweeks before implementing. Can it run half an hour before, so editors can notice if it has not, can it have an automatic kill switch if it is delayed? If it protects next day due to failed run, probably an annoyance, easily fixed, not crisis. -166.137.209.143 (talk) 13:56, 15 May 2013 (UTC)[reply]