W3C home > Mailing lists > Public > public-webplatform@w3.org > December 2012

Admin Tool / MW .Net API/Bot

From: frozenice <frozenice@frozenice.de>
Date: Sun, 16 Dec 2012 04:17:05 +0100
Message-ID: <50CD3D31.5030502@frozenice.de>
To: public-webplatform@w3.org
CC: ryan@ryandlane.com

as all good things come in threes, here's my 3rd thread for the night (huh, it's actually kinda late at night already here).

Some of you already know that I'm working on what the topic says. I wanted to share some information on progress.

What's this about? Basically, I'm creating a program in C# that abstracts the MediaWiki API. Nothing new here,
the awesome part however is, this bot can be controlled via JavaScript (I'm using a .Net JS Engine called Jurassic).

Why JS? Because it's easy to use. I feel it's a lot easier than python, so more people should be able to use it
(comparing with pywikipediabot here). Also, we teach one or two things about JS in the docs. :)

Oh, did I mention it not only runs on Windows, but also on Linux / OS X via Mono? It does.

What has it to do with WPD? Well, the current vision is, to use this to fuel our 'admin tool'. It could fetch
information about pages, categories, files, etc. (a web interface would nicely display all that stuff). It
could also be used to run automated tasks (mass-edit / -move, regular checks / cleanups, some tasks could
automatically fill our bug-tracker based on certain rules).

Possibly the best thing (maybe not for us, but in general) could be to allow users to run custom scripts
(which they write in JS) against the API. These would then create tasks, which will have to be approved by
an admin, maybe including some preview of what will be done. This wouldn't stop people from running their
own copy of the bot, of course, as the MW API is public (there's a writeapi right, tough).

Sounds interesting? You can check out a sample script here http://fro.privatepaste.com/9ed0f985ff

There's not much MW API stuff yet, most of my time went into the .Net <-> JS interfacing. Another awesome feature is,
the program can also be used in other .Net projects (it can be included as a library). All the API and helper classes
can be used, they aren't bound to JS.

If everything works out ok, this will also be good news for .Net+JS folks, as you only need to write your code in C#
and don't worry about JS specific stuff, as the conversion / wrapping is done automatically and even external / .Net
framework stuff can be exposed, even cherry-picking class-members is possible.

So yeah, that's what I'm working on, when I get some rare spare time and yes, C# and JS are my 2 favorite languages
and no, I don't use TypeScript. :)

- fro

Received on Sunday, 16 December 2012 03:17:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:20:45 UTC