Trichome

The Signpost: 01 October 2012

Redirect

Could you please tell the RFC-bot that she should send the messages not to "User talk:Night of the Big Wind" but to User talk:The Banner? Thanks in advance. The Banner talk 15:33, 8 October 2012 (UTC)

Sorry, that should be fixed now. Also "she"? Interesting, I've never really thought about the gender of bots; although I suppose "she" does fit with the general English convention regarding ships etc. --Chris 08:38, 10 October 2012 (UTC)

The Signpost: 08 October 2012

Priyanka Chopra GA review

Someone who was unqualified stared the review. I asked an administrator to delete the review, which I think they did. I noticed that in the nomination page that it still showed as under review by example/unknown. I removed this, but the GA bot put it back with this edit. Can you please clear this up so that someone can start a new review? BollyJeff | talk 12:52, 10 October 2012 (UTC)

I think someone else just fixed it. BollyJeff | talk 12:54, 10 October 2012 (UTC)
Looks like everything is normal again. Torreslfchero (talk) 15:02, 10 October 2012 (UTC)

Greetings! You have been randomly selected to receive an invitation to participate in the request for comment on Wikipedia:Village pump (proposals). Should you wish to respond to the invitation, your contribution to this discussion will be very much appreciated! If in doubt, please see suggestions for responding. If you do not wish to receive these types of notices, please remove your name from Wikipedia:Feedback request service.RFC bot (talk) 16:15, 12 October 2012 (UTC)

Please comment on Template talk:Civility

Greetings! You have been randomly selected to receive an invitation to participate in the request for comment on Template talk:Civility. Should you wish to respond to the invitation, your contribution to this discussion will be very much appreciated! If in doubt, please see suggestions for responding. If you do not wish to receive these types of notices, please remove your name from Wikipedia:Feedback request service.RFC bot (talk) 17:16, 15 October 2012 (UTC)

The Signpost: 15 October 2012

Wikibot

Hi Chris,

Because botclasses.php is getting large and ugerly, and it looks to have a fair bit of 'legacy' (i.e. no-longer-used) code in it, I've started rebuilding a set of PHP classes for bot usage on-wiki.

I expect this to take me quite a long time as I'm early-on in getting familiar with PHP. I'd like to think, if nothing else, you might want to snarf the curl class I've put together in here: https://github.com/Brian-McNeil/NewsieBot-WikiInterface

One thing I noticed knocking a few 'quick-and-dirty' bot processes together with botclasses.php was needing to send an excessive number of requests to get information that could have been pulled all in a single request. I'm of the opinion Perl is "transmission line noise" masquerading as code, and I want to make any bot code look as-simple as the test_one.php program in the above repository. If you, and the other folks who've worked on botclasses.php to-date, are interested in getting a more up-to-date framework together, I'm happy to grant commit access. I take it for granted that anyone with a few years PHP programming under their belt will find some of what I do awful, so no need to 'tiptoe' around saying I've done something badly. Point is to make a more-easily maintained class, and set of extending classes, to handle usual bot functions.

I do have one question, relating to edit-conflict avoidance, am I reading API documentation etc correctly that this works off a timestamp? That seems insane; I'd expect it to work off a revision ID. Do you know if the MW devs are working towards implementing that, or if they need nudged in that direction? --Brian McNeil /talk 17:50, 2 October 2012 (UTC)

Sorry about the delay in responding.
Thanks. Your classes looks good. Yeah, I will certainly agree that was one of the draw backs of botclasses (honestly, I've been meaning to rewrite the damn thing and "do it properly", but, yeah, time is a funny thing). I'm not sure when I'll get a change to contribute something, but my github username is (rather creatively) : chr1sg so it would be nice if you could add me. Also, you might want to list your framework here
Re edit-conflicts. Yeah, from my understanding it is timestamp based. You can try nudging them if you like, although I would suspect the response will either be along the lines of "if it ain't broke, don't fix it" or "yeah, we should fix it, but it'll be a breaking change to the api, break other bots/scripts". --Chris 09:07, 10 October 2012 (UTC)
  • I 'nipped' a bit about editconflict in #mediawiki, and got a sort-of "yeah, it should be better" response.
Have added you to the contributors and expanded stuff a little. I want to keep the page-related stuff in one class, get that right, then move on to adding things like a WikiAdmin.class.php WikiMedia.class.pgp (for images/sound etc).
I thought a "nice to have" (which I stuck in today) was that the bot be able to log whatever it does to a wiki page. You can see that over on this Wikinews page.
There's a heads-up that the API may be impacted by changes being rolled out on Monday, if you spot anything impacting botclasses.php, give me a shout over on Wikinews; I'll fixup the classes I'm developing (a bucketload of the internal code may-well be 'fugly, but the point is to make bot code doing real work easily-read).
I'm relatively pleased with how I'm doing, considering I'd not touched PHP six months ago and haven't had to learn a new programming language in well-over a decade.
Did find a 'bug' today: Added a get_toc($pagename) function, and it doesn't return an error if you request the toc off a nonexistent page (but, if you ask for an 'illegal' page, eg Special:Olympics, it does throw an error).
Happy to have anyone else prod this with a pointy stick, such as whoever wrote the LyricsWiki stuff. Not to roll it into the main classes, but that there's a LyricsWiki.class.php which requires, and extends, whatever they need to use. --Brian McNeil /talk 17:11, 13 October 2012 (UTC)
Logged my first API bug from developing this (41042). And, abstracted a load of the debug output. I don't want to throw it to the lions and add it to the framework list until it does everything an anon user could do with a page. At that point, someone could use it for a basic bot. I note that botclasses.php does a load of admin-type stuff and, you could say, more than a Swiss army knife in some regards. What are the vitally important operations you need botclasses.php for? --Brian McNeil /talk 20:15, 15 October 2012 (UTC)
this give a bit of an idea of the functions most frameworks have. As you can see there's actually quite a bit of difference between what each framework supports (e.g. I've always been pretty happy with just having one edit function, and letting the bot writer do the rest; however phpwikibot has about 3 different functions just for replacing text in a page, and a whole bunch for removing templates etc).

The most important functions would be (imo):

  • get page content
  • get the members of a category
  • subpages of a page
  • what links here for a page
  • template transclusions

Less important (but still useful), are ones like: get page id, page history, user edit count and user contribs.

Also, at some point you'll probably think "hey, you know what would be nice? parsing wikitext!" and have images of a lovely DOM model where you can just go "$template = $page->getTemplate('infobox'); $template->getParam('DoB');". My advice is to sit down and wait until the urge passes (my other advise is, unless your dealing with very simple wikitext, don't use regex).

--Chris 11:46, 16 October 2012 (UTC)

Well got the one to get a page, and a fairly comprehensive one to write a page (or sections thereof). As I've now added a nice function to get a page's TOC, I'm going to look at one to retrieve a specific section from a page. Then I've quite a ways of testing to do on that because I want to see what happens if I try and read, or write, a subsection from a transcluded page.
Subpages should definitely go in this class, along with what links here. Template transclusions? Probably.
For the other stuff, I think those should be classes which extend my initial WikiBot.class.php; so, a WikiBot_Category.class.php, WikiBot_Admin.class.php and WikiBot_Media.class.php to start with. Anything to do with manipulating the content of a page? Not my problem (except when I'm coding it for my own bots). Revision ID is already handled:
$pg_content = $WikiBot->get_page( "Main Page" );
$pg_revid = $WikiBot->revid;
If the devs will take on-board my complaints about using timestamps to try and avoid edit conflicts, instead using revision ids, then I can make the whole thing edit-conflict safe oh-so easily. Fetch page; manipulate content; write new revision. With the revid stored in the WikiBot object, the 'user code' just needs to check it wasn't conflicted. --Brian McNeil /talk 09:34, 19 October 2012 (UTC)

The Signpost: 22 October 2012

GAN section changes followup

Hi Chris,

Since I posted the GAN theater, film, and drama section change proposal at Wikipedia talk:Good articles#.22Theatre.2C film and drama.22 section change proposal, I got some feedback. I think that the best course would be to rename the section, "Fiction media and drama" with subsections, "Film," "Television," "Theatre, dance and opera," and "Other media." And then change the "Media and journalism" section to "Non-fiction media and journalism." I believe these changes would provide more specificity to GA reviewers as well as nominators. Would this work? Thanks. -- Wikipedical (talk) 20:19, 20 October 2012 (UTC)

Sorry, I'm not deliberately ignoring you -- I'm just busy. If I haven't done this by next week, just keep poking me until I do it. Otherwise, I will completely forget about it. --Chris 14:43, 24 October 2012 (UTC)

Some questions

Hey, I know you are the one who runs the GAbot. So, I am asking you those questions: There is a way we can have a list with all users that reviewed any article during each month and how many articles they reviewed? [Example: User:Hahc21/sandbox/ListGAMonth] A similar job is done by another bot when compiling the list of Wikipedians by number of edits. I hope you could help me at this. Thanks. — ΛΧΣ21 05:57, 26 October 2012 (UTC)

The Signpost: 29 October 2012

Leave a Reply