User:Luasóg bot
![]() | This user account is a bot that uses the Luasóg JavaScript framework, operated by Tóraí (talk). It is used to make repetitive automated or semi-automated edits that would be extremely tedious to do manually, in accordance with the bot policy. The bot is currently inactive but retains the approval of the community. Administrators: if this bot is malfunctioning or causing harm, please block it. |
Emergency bot shutoff button
Administrators: Use this button if the bot is malfunctioning. (direct link)
Non-administrators can a malfunctioning bot to Wikipedia:Administrators' noticeboard/Incidents.
About Luasóg
[edit]Luasóg consists of two project streams:
- The Luasóg framework, a JavaScript framework for interacting with the MediaWiki API
- A desktop IDE for writing and executing scripts that use Luasóg
You can use Luasóg immediately on Wikipedia by importing this page in to your vector.js or your monobook.js page (non-Internet Explorer browsers only, see example below). To use the Luasóg framework to access the Wikipedia API off-site, download the desktop IDE from the project page on SourceForge.net.
Luasóg is only in version 0.3 but already has a robust set of wrapper functions for common API calls. For example, using Luasóg you can read a page or category, log in and edit. All calls the WikiMedia API can be access using the request
method. The full Luasóg API is documented here.
Example script
[edit]If you use a browser other that Internet Explorer, the Luasóg framework can be used directly on Wikipedia to easily script otherwise impossible things. For example, the following script will add an edit counter to the My Contributions link at the top of the page.
If you use the new theme, Vector, add the following code to your vector.js page. If you use the old theme, Monobook, add it to your monobook.js page. After adding the code, follow the instructions on that page about how to refresh your browser to see the results.
// include the Luasóg framework
importScript('User:Luasóg bot/framework.js');
// wait for the page to load
window.onload = function(){
// instantiate an instance of Luasog pointing at the en.wiki API
var luasog = new Luasog("http://en.wiki.x.io/w/api.php");
// set up the callback function
var callback = function(data){
// add the number of edits for this user to the inner HTML of the contributions link
document.getElementById("pt-mycontris").innerHTML =
document.getElementById("pt-mycontris").innerHTML.replace
("</a>", " ("+data.query.userinfo.editcount+")</a>");
};
// request the edit count for this use and call callback when done
luasog.request({action:"query", meta:"userinfo", uiprop:"editcount"}, callback);
};
Version 0.3 released
[edit]![Luasóg is released under the GNU GPL v.3.](http://up.wiki.x.io/wikipedia/commons/9/99/GPL_black.png)
Version 0.3 of Luasóg was released on the 24th of March 2010. This should still be considered a development release but is expected to be stable enough for most purposes. All known issues from the previous release have been addressed.
The most important changes since 0.2 is that the IDE is no longer web-based. The web-based IDE dropped from project and the desktop IDE based wholly on local files. Some new methods were added to the frame work (dealign with namespaces and categories).