Operator: [[Sam Korn]] (smoddy)
Automatic or Manually Assisted: Automatic
Programming Language(s): PHP, using Pillar
Function Overview: Change templates on and categorise lists of ships/
Edit period(s): Once
Already has a bot flag (Y/N): Yes
Function Details:
Belhalla describes the task perfectly here:
I'd like to see about getting a bot to process all the articles in four categories: Category:Lists of ship commissionings, Category:Lists of ship decommissionings, Category:Lists of shipwrecks by year, and Category:Lists of ship launches. The number of articles in each category ranges from about 85 up to 125. The processing would be as follows:
- For the three categories Category:Lists of ship commissionings, Category:Lists of ship decommissionings, and Category:Lists of shipwrecks by year: visit each page and replace any template transclusions of the form
((shipeventsNNNN))
with((Shipevents|XXXX))
, whereNNNN
is a year ending in0
, like1870
; andXXXX
is the specific year in the title of the page. Typically, the templates to be replaced appear in a "See also" section. Although most articles will have only one template of the((shipeventsNNNN))
style, year articles near the turn of a decade most often have two. If any article already has the template((shipevents))
, skip it.
- Example 1: In List of ship commissionings in 1876, replace
((shipevents1870))
with((shipevents|1876))
.- Example 2: In List of ship commissionings in 1879, replace
((shipevents1870))
and((shipevents1880))
with((shipevents|1879))
.- For the category Category:Lists of ship launches: Perform the same template replacement as above, PLUS place the article in
[[Category:XXXX ships]]
with a pipe and a space (so the article will sort at the top of the category) like this:[[Category:XXXX ships| ]]
. As above,XXXX
is the specific year in the title of the article. If any article already has the template((shipevents))
skip that task. If any article already has theXXXX ships
category, please add the pipe-and-space ("|
") sortkey
- Example 3: List of ship launches in 1908, replace
((shipevents1900))
with((shipevents|1908))
; add to[[Category:1908 ships| ]]
(with a pipe-and-space sortkey)
Code: User:Sambot/Code/Ships 2.
[[Sam Korn]] (smoddy) 19:47, 13 April 2009 (UTC)[reply]
Trial complete. 20 edits -- successful [[Sam Korn]] (smoddy) 11:37, 17 April 2009 (UTC)[reply]
I've checked the edits, and they look good to me. Anyone else? – Quadell (talk) 13:37, 17 April 2009 (UTC)[reply]