Wikipedia:Bots/Requests for approval/DavidWSBot 1
Tools
Actions
General
Print/export
In other projects
Appearance
From Wikipedia, the free encyclopedia
- The following discussion is an archived debate. Please do not modify it. Subsequent comments should be made in a new section. The result of the discussion was Approved.
Operator: DavidWS (contribs)
Automatic or Manually Assisted: Automatic
Programming Language(s): PHP
Function Summary: Notifies opted-in sysops when a user they have blocked requests an unblock.
Edit period(s) (e.g. Continuous, daily, one time run): Continuous, a 1.5 minute break after each check.
Already has a bot flag (Y/N): N
Function Details: Finds all users in the category Requests for unblock and retrieves the sysop that blocked the user. If the sysop is opted-in then it notifies them using a template I created.
Discussion
[edit]What if the same user requests an unblock multiple times? MaxSem(Han shot first!) 16:37, 26 November 2008 (UTC)[reply]
- Good point you make there. I'll add some code so it doesn't notify more than once. Thanks for bringing that up :) DavidWS (contribs) 16:48, 26 November 2008 (UTC)[reply]
- Okay, I added code to make sure it's not a duplicate notification. DavidWS (contribs) 16:52, 26 November 2008 (UTC)[reply]
- The main concern I have is that this could be abusable. If its opt-in, it would remove most of the risk, but I can imagine situations like:
- 1. Troll creates account with offensive username
- 2. Admin blocks
- 3. Troll requests unblock, causing the bot to paste the offensive username on the admin's talk page.
- Not a major abuse, but its possible. It may be worth it to parse the block reason and not actually show the name if its a username block, or have some regexes for "bad usernames."
- Also, can the bot handle rangeblocks, autoblocks, and hardblocks of an IP affecting a registered user? And for the "duplicate notifications," is there a time limit so that requests that are really separate (long time between requests, admin blocks the same user twice, etc.) still do a notification for both. Mr.Z-man 17:21, 26 November 2008 (UTC)[reply]
- I could regex match the username to make sure it's not offensive, and essentially just censor it on the admin page, or not show it at all. I don't have anything set up for rangeblocks, autoblocks, or hardblocks, although I will likely add that later. I'm going to take a look now, as that shouldn't be hard to implement. However, I'd rather wait and request that as a seperate task later. For the duplicate notifications, I can have it check how long ago the template was added to the page. Presently, the sysop will need to remove the template before it will notify again. DavidWS (contribs) 17:25, 26 November 2008 (UTC)[reply]
- I'm going to write a PCRE to match offensive terms. Also, the autoblocks should be easy, it's just a separate category. I can have the bot load users listed there too. Again, however, I would rather wait until a test to make sure it works properly with normal blocks (as it should, I've tested it somewhat locally). I'll work on that regex. DavidWS (contribs) 17:29, 26 November 2008 (UTC)[reply]
- I see no problems with offensive usernames. The blocking admin had already seen them while blocking, even without the bot they can receive messages from good-faith users with username mentioned. At most, we could tweak the message template to look like "the user you blocked is requesting an unblock [[User talk:$1|here]]". MaxSem(Han shot first!) 17:33, 26 November 2008 (UTC)[reply]
- Okay, then I'll forget the censorship thing. I do agree with you. I'll work on something that checks the timestamp of the template if it is already there, and if it is over two hours old, add a new one. DavidWS (contribs) 17:48, 26 November 2008 (UTC)[reply]
- I have decided upon, along with the notifcation template, adding an HTML comment in the form <!--unblocknote:(Username,Timestamp)-->, and then extract the timestamp with that. I have already written code to do so. If the difference between now and that timestamp is 21600 seconds (6 hours), then it will post the notification again. DavidWS (contribs) 18:10, 26 November 2008 (UTC)[reply]
- As it is only an opt-in system and the code looks good in my opinion, Approved for trial (30 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Please report back here with your results. I will opt-in myself as an additional user. — E ↗ 00:03, 6 December 2008 (UTC)[reply]
- Thanks. I'll let you know. DavidWS (contribs) 00:21, 6 December 2008 (UTC)[reply]
- It was rough at first but I worked out all the kinks. Still has trial edits left, but it now notifies right and the matching of timestamp html comments works well. I had to fix a lot of bugs though. DavidWS (contribs) 16:51, 6 December 2008 (UTC)[reply]
- Thanks. I'll let you know. DavidWS (contribs) 00:21, 6 December 2008 (UTC)[reply]
- As it is only an opt-in system and the code looks good in my opinion, Approved for trial (30 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Please report back here with your results. I will opt-in myself as an additional user. — E ↗ 00:03, 6 December 2008 (UTC)[reply]
- I have decided upon, along with the notifcation template, adding an HTML comment in the form <!--unblocknote:(Username,Timestamp)-->, and then extract the timestamp with that. I have already written code to do so. If the difference between now and that timestamp is 21600 seconds (6 hours), then it will post the notification again. DavidWS (contribs) 18:10, 26 November 2008 (UTC)[reply]
- Okay, then I'll forget the censorship thing. I do agree with you. I'll work on something that checks the timestamp of the template if it is already there, and if it is over two hours old, add a new one. DavidWS (contribs) 17:48, 26 November 2008 (UTC)[reply]
- I see no problems with offensive usernames. The blocking admin had already seen them while blocking, even without the bot they can receive messages from good-faith users with username mentioned. At most, we could tweak the message template to look like "the user you blocked is requesting an unblock [[User talk:$1|here]]". MaxSem(Han shot first!) 17:33, 26 November 2008 (UTC)[reply]
- I'm going to write a PCRE to match offensive terms. Also, the autoblocks should be easy, it's just a separate category. I can have the bot load users listed there too. Again, however, I would rather wait until a test to make sure it works properly with normal blocks (as it should, I've tested it somewhat locally). I'll work on that regex. DavidWS (contribs) 17:29, 26 November 2008 (UTC)[reply]
- I could regex match the username to make sure it's not offensive, and essentially just censor it on the admin page, or not show it at all. I don't have anything set up for rangeblocks, autoblocks, or hardblocks, although I will likely add that later. I'm going to take a look now, as that shouldn't be hard to implement. However, I'd rather wait and request that as a seperate task later. For the duplicate notifications, I can have it check how long ago the template was added to the page. Presently, the sysop will need to remove the template before it will notify again. DavidWS (contribs) 17:25, 26 November 2008 (UTC)[reply]
- (indent) Very nice work David. Remember, fixing errors and improvements are what a bot operator does for a living. You seem to have ironed out all the errors and the latest edit looks excellent. Let me know when your trial edits are complete. — E ↗ 03:49, 7 December 2008 (UTC)[reply]
- Well, technically, it is now over the trial limit due to some edits I made with the account a while back to give it autoconfirmed status, so I figured I'd turn it off and let you know. (I just added something so it notifies me of what it has done every twelve hours). Anyway, 31 edits, so, yeah. DavidWS (contribs) 18:58, 14 December 2008 (UTC)[reply]
- Trial complete. DavidWS (contribs) 20:00, 14 December 2008 (UTC)[reply]
- Approved. Edits look fine, you may need to fix the notifications to yourself (it added 5 over a period of 6 minutes, which is obviously incorrect). — E ↗ 05:11, 15 December 2008 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. Subsequent comments should be made in a new section.