Why are we importing gadgets to new sites, I thought that the whole purpose of ResourceLoader was to stop the proliferation of gadgets and especially versions of gadgets. In fact we have been trying to look to standardise and align the gadgets to a master copy in a number of places.
Regards, Andrew
On Tue, 20 Mar 2012 22:15:05 -0400, mah@wikimedia.org (Mark A. Hershberger) wrote:
In the past few months, I've needed to test gadgets that are used on WMF sites, but didn't have an easy way to copy them from, say, Commons to Beta in Labs.
I hacked something together and then forgot about it until Chris McMahon (the WMF's new QA guy) wanted something similar for one of his test wikis a couple of weeks ago. I couldn't find it, so last night I rewrote the script from scratch.
The script is pretty ugly and, normally, I might commit it to SVN and work on it there, but we're in the process of moving to Git, so I've gone ahead and created a gitorious repository:
https://gitorious.org/wiki-gadgets
Lots of hard-coding that could be cleaned up, and it could use the API to copy from one wiki to another, but its a start. I'm sharing it here so that other people can begin to use it.
It just blats the import-able file out on standard output for now, and it only copies from Commons, so it should be used in the following way:
$ php dupe-gadgets.php > import-this-file.xml [ Go to Special:Import on your wiki and import. ]
I hope that it helps someone!