Commons:Bots/Requests/File Upload Bot (Vonvikken)

From Wikimedia Commons, the free media repository
Jump to: navigation, search

File Upload Bot (Vonvikken)

I need to speed up the repetitive and time-consuming process of uploading comuni maps. Each time I have 50-100 little svg files to load, with a standard description (only changing the name), it takes a whole day to be done manually.

Operator: Vonvikken (talk)

Bot's tasks for which permission is being sought: uploading SVG maps of Italian comuni (like these) with description.

Automatic or manually assisted: automatic, supervised.

Edit type (e.g. Continuous, daily, one time run): as far as I have a batch of new maps, once or twice a month.

Maximum edit rate (eg edits per minute): 30-60 uploads per minute, depending on the file size.

Bot flag requested: (Y/N): Yes

Programming language(s): Perl

Vonvikken (talk) 18:59, 11 November 2009 (UTC)

Discussion

  • Could you please make a test run? I also think will be good idea to decrease rate of upload. --EugeneZelenko (talk) 15:21, 12 November 2009 (UTC)
Of course! :-) How can I decrease the upload rate? Should I use a delay instruction in the script? Do you think that a rate of 10-12 uploads per minute would be good? Thank you! -- Vonvikken (talk) 19:13, 12 November 2009 (UTC)
Ok, it works well, I tried to upload some files and there were no problems! I also put a sleep instruction in the code to slow the upload rate to 10 per minute. P.S.: the upload rate doesn't include the time the file takes to upload, only the time interval between two requests... so the rate is even less than 10 per minute! -- Vonvikken (talk) 15:07, 13 November 2009 (UTC)
Looks OK for me. I could suggest to add also commune category if such category exists. --EugeneZelenko (talk) 15:35, 13 November 2009 (UTC)
Thank you. Such categories also exist. Look at Category:Maps_of_municipalities_of_the_province_of_Campobasso (under construction...) and Category:Maps_of_municipalities_of_the_province_of_Isernia. When I add a new province, I also add a category like these. -- Vonvikken (talk) 16:39, 13 November 2009 (UTC)
Only one thing... Could I have the bot flag assigned? Without it my watchlist is a mess... ;-) -- Vonvikken (talk) 23:54, 14 November 2009 (UTC)
Please ask other admins and active bots owners (like User:Multichill to look into this request. --EugeneZelenko (talk) 15:51, 15 November 2009 (UTC)

Ok, I'll do it! Thank you! ;-) -- Vonvikken (talk) 19:59, 15 November 2009 (UTC)

Looks good, just a couple of small points:
  • You should probably make the filenames somewhat longer. Something like "Map of Comune of Spinete (Campobasso, Italy).svg" instead of Spinete light.svg
  • I see the maps are placed in the province category, would be nice to also place it in the municipality/town/village category
Multichill (talk) 13:33, 18 November 2009 (UTC)

If you've applied what Multichill said, then I'll approve this bot. Please comment here when you've done that. Best, Kanonkas // talk // e-mail // 19:34, 18 November 2009 (UTC)

Ok! I modified a local script I use to create infos for files, now the description look like this (e.g., for Map of comune of Montaquila (Isernia, Italy).svg):
== {{int:filedesc}} ==
{{Information
|Description={{en|1=Comune of Montaquila (Isernia, Italy)}}
{{it|1=Comune di Montaquila (Isernia, Italia)}}
|Source={{own}}
|Author=[[User:Vonvikken|Vonvikken]]
|Date=2009-11-18
|Permission=
|other_versions=[[File:Map of comune of Montaquila (Isernia, Italy)_light.svg|150px]]
}}

{{inkscape}}
[[Category:Maps of municipalities of the province of Isernia]]
[[Category:Montaquila (Isernia)]]

== {{int:license}} ==
{{PD-self}}
As you can see, I added a reference to a category named with the pattern [[Category:comune (province)]], but I should find a way to check whether such a category also exists or, in case, create it. Do you know if there is a way to make this process automatic (like some code from another bot, or some documentation so I can write it on my own)? Thank you! -- Vonvikken (talk) 22:42, 18 November 2009 (UTC)
With places we usually do Montaquila, Isernia. You could generate the category tree based on the article tree at Wikipedia or some geo database.
BTW, categories should always be at the bottom of the text. Multichill (talk) 12:34, 22 November 2009 (UTC)
I found the way to deal with new and existing categories using the MediaWiki APIs, the bot will check whether a category exists or not, adding a new one if needed. However, I found a lot of existing categories with only the name, without province (see Category:La Spezia or Category:Isernia), I think it's better to leave them alone... ;-) And yes, I will move the categories at the bottom! :-) I'll post here the results, when I finish. Regards, -- Vonvikken (talk) 13:56, 22 November 2009 (UTC)
Ok, I did it, as you can see in the bot's contributions. I uploaded the maps of 4 comuni (two versions each) and created the related categories. Before running the bot, I check with a local script whether a category already exists, and in case I edit the bot's input file to avoid duplicates. I got only a problem, but I think it isn't related to the bot itself: when I upload the bigger version of an image the wiki treats it like a malicious file, and I have to reload it manually. Do you know why? Apart this issue, I fixed the problem, the files need to be saved in the plain SVG format, not in the Inkscape one. Now it works perfectly! Tell me your opinion please, thank you! Best regards, Vonvikken (talk) 01:06, 25 November 2009 (UTC)
Everything looks good. ✓ Approved. Kanonkas // talk // e-mail // 12:09, 27 November 2009 (UTC)