Yes, I agree. However, it should not be assumed that the agent is a robot, it may be a thick client written (like mine) in AJAX, GTK or some other thing.
A robot in this context is widely defined as any program that parses server responses and acts based on those responses, this would include your script
I'm not sure what you mean by an easy to parse format? Just sending the token as 32 plaintext chars seems as easy as it could possibly be.
As I said I'm thinking of a *general* interface for robots, not just something to get one single attribute on edit pages, although getting the token would be included it would only be a small part of it.
For example, I wrote a robot to upload files two days ago, what has to be done to upload a file to wikipedia is:
1. Send a POST request with the following: (so far so good)
wpUpload => 'Upload file', # actually it seems like this only has to be sent, not with these specific contents, the code that parses it is: } else if ( 'submit' == $this->mAction || $this->mUpload ) { where mUpload is this string. wpUploadFile => [ $file ], wpUploadDescription => encode($encoding, $description), wpUploadAffirm => 1,
2. Process whatever SpecialUpload spits out which can be * Error: ** The image page is protected, wfMsg( 'protectedpage' ) ** The filetype is not accepted, wfMsg( 'badfiletype' ) ** The name is not accepted, wfMsg( 'illegalfilename' ) * Warning: ** The filesize (too big) ** The name of the file (s/ /_/) ** The file is empty ** The file already exists * [.. probably something missing here]
in the case of an error you'll find <h4 class='error'> on the page, and <ul class='warning'> if you'll get a warning, however nothing tells you *what kind of warning* so you'll have to resort to actually looking up the warnings in question in Language.php (this is assuming you're using english and not one of the ~80 other languages) to tell what kind of warning you just recived, this of course ignores all the excess html you just recived which you have no use for at all.
So, what I'd like for Special:Upload is to be able to submit a POST request to http://commons.wikimedia.org/wiki/Special:Upload?action=robot and have it return something like:
largefile,fileexists
It could even return all possible strings as boolean values:
largefile=0 fileexists=1 emptyfile=1 [...]
or, in the case of ?action=robot on an article: token=1231asdfasdt....
The the format is something which can be agreed on, but the actualy point is that there's alot more that needs a robot interface than just your 32 character edit token.