Jump to content

Wikipedia:Bots/Requests for approval/Mobius Bot 2

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Mobius Clock (talk | contribs) at 21:52, 8 May 2010 (→‎Mobius Bot 2: r). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Operator: Mobius Clock (talk · contribs)

Automatic or Manually assisted: Automatic

Programming language(s): Python

Source code available: 'Coming soon', I just want to tidy it up and optimize here new code

Function overview: Tagging categories for CfD (specifically in relation to this BOTREQ)

Links to relevant discussions (where appropriate): See BOTREQ above

Edit period(s): As-and-when-required, apparently there are quite a lot of these categories to do

Estimated number of pages affected: several hundred in Category NS

Exclusion compliant (Y/N): Not relevant

Already has a bot flag (Y/N): Y

Function details: As per the BOTREQ, the bot would add to all nominated categories the following:

{{subst:Cfr|<ProposedName>|<Nomination name>}}

Where ProposedName is in the form 'Settlements established in <year>' or 'Settlements in <place>', and the Nomination name is the CfD heading for the current batch. ProposedName is obtained via a regex sub applied to the current category name:

(?:Cities(?:[,] towns and villages|[ ]and towns)|Settlements)( established)? in (.*?)$; replace with 'Populated places\1 in \2'

Discussion

So are you looking for approval for all CfD tagging? Or just for this case? How do you get the list of pages to tag? - Kingpin13 (talk) 22:19, 5 May 2010 (UTC)[reply]

This would be a big help. There are many hunderds of catagoies than need tagging to be moved, many listed at User:Carlaude/Rulers. See also the consensus here: Wikipedia talk:Categorization/Categorising human settlements.
BTW, the "<Nomination name>" can be anything, but sould be all the same for related catagoies, e.g. "More settlements", "Former settlements", etc. şṗøʀĸɕäɾłäů∂ɛ:τᴀʟĸ 22:23, 5 May 2010 (UTC)[reply]
Mobius indicated here that tagging other categories would require only a trivial change from a programming standpoint, so I ask that approval be given for all CfD tagging. Having a bot to tag large numbers of pages for group nominations would be extremely useful (for instance, I have the same tagging request for the 700+ subcategories of Category:Image-Class articles), and the process for tagging categories for group noms is essentially the same regardless of the categories involved. -- Black Falcon (talk) 22:40, 5 May 2010 (UTC)[reply]
Judging from the amount of work there seems to be to do, I would like to request approval for all CfD tagging, which would involve using 98% identical code between runs. As for the list of pages to tag, I can either get the nomination list and convert to a bot-readable text file, or have people provide me with such a file (as in this case). - Mobius Clock 22:54, 5 May 2010 (UTC)[reply]
As we have done in this case, we typically do trial CFDs before tagging all the categories in a group. şṗøʀĸɕäɾłäů∂ɛ:τᴀʟĸ 01:45, 6 May 2010 (UTC)[reply]

Hmm, looks like these tags have already been done. Is there another CfD we can do a trial on? Also, does your code check if the category is already tagged before adding a tag to it? - Kingpin13 (talk) 16:28, 7 May 2010 (UTC)[reply]

I'm not sure about another CfD, we may have to wait for one to come up! As for checking whether a cat is already tagged, the bulk of the code only executes if this evaluates to true: - Mobius Clock 16:33, 7 May 2010 (UTC)[reply]
if (page.get().find('Cfr full') == -1): #In other words, only edit if we can't find 'Cfr full' on the page
I sure that most of the items at User:Carlaude/Rulers are not tagged. Last I looked, not even those at the start were tagged. Were you looking here instead? şṗøʀĸɕäɾłäů∂ɛ:τᴀʟĸ 18:25, 7 May 2010 (UTC)[reply]
Mmm, yeah, I was looking at the second one, which was the specific reason this BRfA was started (afaik), but the bot is also wanting approval to do other CfD tagging as well. User:Carlaude/Rulers doesn't seem to load for me, might just be because it's too long. Not sure if this bot is actually doing what User:Carlaude/Rulers is listing (since I can't see it). Mobius, is it possible to find something to do some trial edits on? We can always do a mock up in userspace if it comes to it. Best, - Kingpin13 (talk) 19:17, 7 May 2010 (UTC)[reply]
I can offer a list of about 150 categories for speedy renaming (in groups of 47, 65 and 39 categories), but the code to add the tags would be slightly different: {{subst:cfr-speedy|<ProposedName>}}
If that would be a problem, I can try to find another group of categories which would need to be tagged with the regular/standard CfD renaming template. -- Black Falcon (talk) 04:17, 8 May 2010 (UTC)[reply]
The code I've written is really for the settlement categories, but I'm sure it wouldn't take too long to adapt it if you'd like to do those ones instead, although that might constitute a different task. Personally I'd rather stick to the original one. Carlaude, would it be possible to split User:Carlaude/Rulers into smaller sets, it won't load for me either. - Mobius Clock 09:45, 8 May 2010 (UTC)[reply]
I have been trying to do that-- but have trouble loading or editing that page myself. I will create two new pages with half the data in each. They are done and ready once User:Carlaude/Rulers2 and User:Carlaude/Rulers3 are not redlinks. şṗøʀĸɕäɾłäů∂ɛ:τᴀʟĸ 15:37, 8 May 2010 (UTC)[reply]
No. 2 won't load for me, but 3 works fine, and once I've tweaked the regex slightly to take into account the various possible permutations of 'Settlements in Foo' I'm ready to go, pending trial approval and a relevant CfD! - Mobius Clock 19:48, 8 May 2010 (UTC)[reply]
'K. Now they are split three-ways. User:Carlaude/Rulers, User:Carlaude/Rulers2, and User:Carlaude/Rulers3. şṗøʀĸɕäɾłäů∂ɛ:τᴀʟĸ 20:34, 8 May 2010 (UTC)[reply]
OK, code is updated and can handle all the permutations given in the list. I know it's a kludge, but it gets the job done! - Mobius Clock 21:52, 8 May 2010 (UTC)[reply]