Wikipedia:Bots/Requests for approval/StatusBot
Operator: TheFearow
Automatic or Manually Assisted: Automatic
Programming Language(s): Java
Function Summary: Updates user subpages (such as User:StatusBot/Status/TheFearow) to update the status of users
Edit period(s) (e.g. Continuous, daily, one time run): continuous, every 5 minutes
Edit rate requested: 6 edits per minute
Already has a bot flag (Y/N): N
Function Details: This page updates user subpages, such as User:StatusBot/Status/TheFearow, to either say "online" or "offline". These pages can then be transcluded into other templates etc for user status updaters, to see who is online. These can be useful if you need to contact an online admin. The status is deteremined by checking for the users last edit, and seeing if the timestamp is over 15 minutes ago. If it is, it marks offline, otherwise, it marks online.
Discussion
- I can see a point for this, and a point against it. Is this just going to be for admins? Or anyone who wants it?
- To help users know which 'admins are online', would be a good thing, especially for "newbies" who may not have a wide friend base.
- I know some/many users do do this themselves... But are these edits maybe classable as pointless extra edits...? Im not saying no here, just, is it worthwhile doing? Reedy Boy 14:53, 2 August 2007 (UTC)
This seems harmless (not necessarily beneficial, just harmless). The bot only edits its own user subpages, it automates a function may users consider tedious, and it introduces no significant server load. (Checking maxlag might be a good idea anyway, though.)
There is one issue related to the definition of "away": a user not editing for the past 15 minutes != that user is away. The inverse is also true. But hopefully those using the bot's services will understand this.
Just a couple of questions about the behavior of the bot, also: does it use a text file, a HashMap/TreeMap, an object for each user, or something else? If the bot uses polling, how often does it poll? Thanks :) GracenotesT § 18:11, 2 August 2007 (UTC)
- The bot will operate for anyone who adds their userpage to a category. It seems worthwhile, because if they do any edits, they are online. I know the 15 minutes is an approximate time, but it seems correctish, and usually a good indication. The category would have a disclaimer that it is not accurate. For the behaviour, it just checks all users in the category every 5 minutes, using a SQL query directly to the DB (it first checks the dblag, and if its lagged more than a minute, it reads from the api). It does this from the toolserver, checking the latest entry in the "recentchanges" table for the user, and comparing the timestamp of that to the current timestamp. Regarding maxlag, this shouldn't be a huge problem, but does introduce some issues. It's easier to check slave lag directly. Matt/TheFearow (Talk) (Contribs) (Bot) 21:09, 2 August 2007 (UTC)
- When you check slave lag, you're only checking the lag of the Toolserver's s1 cluster slave. I think it'd be best if you used maxlag in addition to the edit rate you have chosen, only so if one of the slaves in the s1 cluster is lagged, you wait to edit, giving humans priority, until things are stable again. Otherwise, I see no problems with this request. Could we see: 1.) an example of the template this bot would write, and 2.) the source code? — Madman bum and angel (talk – desk) 05:53, 3 August 2007 (UTC)
- The toolserver slave is usually the most lagged, as it is furthest away geographically, and therefore the slowest. I could try and implement maxlag, but it would take a bit. For 1, this is easy. It's a page with either the content of "online" or "offline". A single word page. For two, ill publish the code on monday, when i've got access to the code again. Matt/TheFearow (Talk) (Contribs) (Bot) 11:06, 3 August 2007 (UTC)
- When you check slave lag, you're only checking the lag of the Toolserver's s1 cluster slave. I think it'd be best if you used maxlag in addition to the edit rate you have chosen, only so if one of the slaves in the s1 cluster is lagged, you wait to edit, giving humans priority, until things are stable again. Otherwise, I see no problems with this request. Could we see: 1.) an example of the template this bot would write, and 2.) the source code? — Madman bum and angel (talk – desk) 05:53, 3 August 2007 (UTC)
I think that's best, as the user can then "style" it any way he or she likes, using {{#switch: to add a green/red light, {{ucfirst: to capitalize it, or to do whatever he/she needs to do. Perhaps checking the bot status can be integrated into {{User status}} in the future. The distant future; let's make sure the bot's stable first. I'm willing to give this a trial; however, you mentioned you didn't have access to the code. Do you only have the compiled application? It'd be best if you had the code so any errors could be corrected quickly and the trial could go on. — Madman bum and angel (talk – desk) 15:08, 3 August 2007 (UTC)
- No, i'm at my dads, codes at my mums. I'll have access monday, I forgot to bring it with me. I did code this myself, and I have the code. And yes, that was my reason for a simple online/offline, it means you can do anything you want with it, rather than having to use a premade template. I can start the trial monday. Matt/TheFearow (Talk) (Contribs) (Bot) 01:21, 4 August 2007 (UTC)
- Could this bot check for an accounts last action (not just an edit), I'm often online taking care of deletions, but not editnig otherwise. — xaosflux Talk 18:59, 4 August 2007 (UTC)
- It checks for the last entry in the recentchanges table, so that includes logs etc. So deletions etc would count. Matt/TheFearow (Talk) (Contribs) (Bot) 21:45, 4 August 2007 (UTC)
- I have added one new feature, it will write User:StatusBot/Status/TheFearow/TimeGone as well as the plain page (User:StatusBot/Status/TheFearow), so users can also have a "Status: online (Gone 23 minutes)" style message, with the TimeGone one being how long they are gone. I think I have answered all questions, and I am ready for a trial.
A user has requested the attention of a member of the Bot Approvals Group. Once assistance has been rendered, please deactivate this tag by replacing it with
{{t|BAG assistance needed}}
. Matt/TheFearow (Talk) (Contribs) (Bot) 21:57, 5 August 2007 (UTC)
- I have added one new feature, it will write User:StatusBot/Status/TheFearow/TimeGone as well as the plain page (User:StatusBot/Status/TheFearow), so users can also have a "Status: online (Gone 23 minutes)" style message, with the TimeGone one being how long they are gone. I think I have answered all questions, and I am ready for a trial.
- It checks for the last entry in the recentchanges table, so that includes logs etc. So deletions etc would count. Matt/TheFearow (Talk) (Contribs) (Bot) 21:45, 4 August 2007 (UTC)
- I'm a little confused :/ Is this going to scrape the entire recent contrbutions table, matching names, or is it going to pull contributions lists for people who sign up for it? The later soudns less costly, but will eventually have diminishing returns. — xaosflux Talk 17:03, 6 August 2007 (UTC)
- Certainly would be less costly - Just have to do something like http://en.wikipedia.org/w/index.php?title=Special:Contributions&limit=2&target=Reedy+Boy - ie a small limit... Reedy Boy 21:53, 6 August 2007 (UTC)
- It scans a category, and for each user who is signed up, does a single small SQL query to the recentchanges table, to get the timestamp of the last action by that user. That includes log entries and edits. It does pretty much exactly what reedy boy said, but with a limit of 1, and directly into the MySQL server. The query looks something like "SELECT rc_timestamp FROM recentchanges WHERE rc_user_text = TheFearow ORDER BY rc_id DESC LIMIT 1". I think that's pretty accurate, but its not exact. I can get the exact one if necessary. Matt/TheFearow (Talk) (Contribs) (Bot) 22:29, 6 August 2007 (UTC)
- As the list gets bigger, won't this querey start getting expensive (e.g. Target user hasn't edited in 2 months; and recentchanges isn't indexed by username, so its gong to be longer and longer queries, isn't it?) — xaosflux Talk 03:27, 7 August 2007 (UTC)
- It scans a category, and for each user who is signed up, does a single small SQL query to the recentchanges table, to get the timestamp of the last action by that user. That includes log entries and edits. It does pretty much exactly what reedy boy said, but with a limit of 1, and directly into the MySQL server. The query looks something like "SELECT rc_timestamp FROM recentchanges WHERE rc_user_text = TheFearow ORDER BY rc_id DESC LIMIT 1". I think that's pretty accurate, but its not exact. I can get the exact one if necessary. Matt/TheFearow (Talk) (Contribs) (Bot) 22:29, 6 August 2007 (UTC)
- Hold on. I don't like the (time gone) feature unless it's a template that does some sort of date/time calculation based on the current time. The bot should not be editing that often. — madman bum and angel 02:58, 7 August 2007 (UTC)
- It's only editing every 5 minutes. Also, regarding the expensive query, i'll just get recentchanges indexed by username. I believe you can just request that such an index is placed to the toolserver admins, which I will do. Matt/TheFearow (Talk) (Contribs) (Bot) 04:23, 7 August 2007 (UTC)