The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was Approved.

Operator: Basilicofresco (talk · contribs)

Automatic or Manually assisted: auto (after a period of testing)

Programming language(s): python

Source code available: not yet (pywikipedia + custom script)

Function overview: analizes selected articles, checks a matching target on Commons and then add ((commons)) or ((commons cat)).

Links to relevant discussions (where appropriate):

Edit period(s): few times per year or less

Estimated number of pages affected: few thousands?

Exclusion compliant (Y/N): Y

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

Function details: this task aims to add to the article the link to Commons when unambiguous related media content is found.

  1. It will start from a offline generated list of selected articles with these characteristics:
    • round brakets in the article name, eg. Alcobaça (Portugal);
    • "External links" section (I plan to improve in the future the ability of the script to place the template in the right place even without "External links" section);
    • article without any Commons template (exclusion regex: ([Cc]ommons|[Pp]ic|[Cc]ommonspar|[Cc]ommonspiped|[Cc]ommonsme|[Ss]isterlinkswp|[Ww]ikicommons|[Cc]ommonstiny|[Cc]ommons-gallery|[Gg]allery-link|[Cc]ommonsimages|[Ww]ikimedia[ _]Commons|[Cc]ommons-inline|[Ww]ikicommons-inline|[Cc]ommons[ _]category|[Cc]ommons[ _]cat|[Cc]ommonscat-inline|[Cc]ommons[ _]cat[ _]left|[Cc]ommons2|[Cc]ommonsCat|[Cc]ommoncat|[Cc]ms-catlist-up|[Cc]atlst[ _]commons|[Cc]ommonscategory|[Cc]ommonscat|[Cc]ommonsimages[ _]cat|[Cc]ommons[ _]cat4|[Cc]ommonscat[ _]left|[Cc]ommons[ _]and[ _]category|[Cc]ommons[ _]and[ _]cat)).
  2. checks Commons for a matching gallery or category with:
  3. adds the right template in the right place (eg. ((commons|Alcobaça (Portugal))) or ((commons cat|Alcobaça (Portugal))) at the top of the External links section)

Discussion[edit]

((BAGAssistanceNeeded)) Within 10 days I did not see any question. Can I start a test run? -- Basilicofresco (msg) 13:20, 15 July 2010 (UTC)[reply]

Seems straightforward. It might be more straightforward to check for the presence of commons templates using the API's prop=templates than a regex, as then you don't have to worry about capitalization, space versus underscore, new redirects, and the like. Anomie 16:15, 15 July 2010 (UTC)[reply]
Seems like most of this (except for the external links section bit) can be done with a toolserver database query. Im not sure if you have a toolserver account, but you may always ask at WP:DBR for some help. DB queries are much faster and in my oppinion, easier, than using the mediawiki API. Tim1357 talk 23:17, 15 July 2010 (UTC)[reply]
Perhaps this would work? Im away from my computer now so I cant test it. Tim1357 talk 23:40, 15 July 2010 (UTC)[reply]

Thank you for your suggestions. Well, the query would create the list much faster... but I'm (still) not used to sql and in order to avoid mistakes I would prefer to keep strict control on every step of the task. I'm going to start from a dump generated list of pre-selected articles (step 1) and this will greatly speed up the whole process. -- Basilicofresco (msg) 07:54, 18 July 2010 (UTC)[reply]

I'm leaving tomorrow for a trip, so I will not able to run any script until second half of August. See you! -- Basilicofresco (msg) 07:58, 21 July 2010 (UTC)[reply]

((BAGAssistanceNeeded)) I'm back. I will run the script on my home computer so the efficiency of the list-creator script is not critical and most of all does not affect Wikimedia servers. -- Basilicofresco (msg) 14:30, 18 August 2010 (UTC)[reply]

It all looks Basilicofresco, but I'd like to see some community discussion about a bot adding these templates. Spam a few talk pages explaining what you hope to do. Tim1357 talk 00:49, 19 August 2010 (UTC)[reply]
Ok, done! -- Basilicofresco (msg) 11:11, 20 August 2010 (UTC)[reply]
Could you link the discussions? –xenotalk 14:51, 3 September 2010 (UTC)[reply]
Sure: Wikipedia talk:WikiProject Images and Media/Commons#FrescoBot 6, Template talk:Commons#FrescoBot 6, Template talk:Commons category#FrescoBot 6. No replies. If you feel I missed the appropriate talk page, feel free to start there the discussion. -- Basilicofresco (msg) 10:11, 6 September 2010 (UTC)[reply]
Note posted @ VPR (Wikipedia:Village pump (proposals)#Proposed bot to add "Commons" and "Commons category" templates to articles). –xenotalk 13:25, 20 September 2010 (UTC)[reply]
It seems no one cares ... Approved for trial (25 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Mr.Z-man 19:00, 2 October 2010 (UTC)[reply]

Trial complete. This morning I wrote and tested the script. Fixed 1st and 2nd edit due a stupid typo. No problems on subsequent edits. As you can see, if a redirect is found on Commons, the bot follows it and then analyze the target. -- Basilicofresco (msg) 10:42, 10 October 2010 (UTC)[reply]

I have no hurry, however after 4 months... ;) ((BAGAssistanceNeeded)) -- Basilicofresco (msg) 21:10, 19 October 2010 (UTC)[reply]

November has arrived and I had not one single complaint about this task. If you are still doubtful, the best thing to do is to approve a 500 edits trial and wait for any reaction. -- Basilicofresco (msg) 23:11, 1 November 2010 (UTC)[reply]

For the record, the edits are here. I noticed 14 cases where your bot linked to a category when a page or redirect to a page exists on Commons, for example this edit linked to Commons:Category:Asparagus rather than Commons:Asparagus (from Commons:Asparagus (genus)). In fact, in that particular example how did it find Commons:Category:Asparagus at all?
I also see the edit to Georgia (U.S. state) was removed without explanation, although probably because the article had ((Sister project links)). It may be worth checking for that template too. Anomie 23:18, 10 November 2010 (UTC)[reply]

First of all, thank you for your attention.

Basilicofresco (msg) 20:23, 11 November 2010 (UTC)[reply]

I only asked about the gallery versus category because your function details list checking for galleries first. As for the other, that sounds like a discussion that should be started somewhere else. Anomie 03:14, 12 November 2010 (UTC)[reply]
I started Template talk:Commons category#Commons / Commons cat vs. Sister project links. -- Basilicofresco (msg) 00:15, 16 November 2010 (UTC)[reply]

Refined proposal[edit]

The "Categories vs. galleries" issue can be resolved using ((Commons and category)) (I almost forgot about it). So, here is the proposal:

If this proposal sounds reasonable, please write below: "uhm... sounds reasonable" and sign. ;) Thanks. -- Basilicofresco (msg) 08:45, 21 November 2010 (UTC)[reply]

Works for me. BTW, you may want to drop a note on Template talk:Sister project links since your post at Template talk:Commons category doesn't seem to be drawing any response. Anomie 15:08, 21 November 2010 (UTC)[reply]

 Approved. WP:SILENCE seems to apply to the discussions regarding ((Sister project links)) vs ((Commons cat)). Anomie 02:38, 1 December 2010 (UTC)[reply]

The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.