Wikipedia:Bots/Requests for approval/TedderBot 4
- 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: Tedder (talk · contribs)
Automatic or Manually assisted:
Programming language(s): perl
Source code available: yes, GitHub
Function overview: adds wikilinks inside {{Anime voices}}
template
Links to relevant discussions (where appropriate): [1], [2], [3]
Edit period(s): One-time
Estimated number of pages affected: 983
Exclusion compliant (Y/N): Yes (trivially skipping pages with exclusion)
Assert Edit flags used (exists, user/bot, none): None
Already has a bot flag (Y/N): Yes
Function details:
- Goes through articles (only in article space, not in any other namespace) in Template:Anime voices and replace instances like {{Anime voices|Some Name|Some Other Name}} with {{Anime voices|[[Some Name]]|[[Some Other Name]]}}.
- Not using "assert edit", as the script I based it on didn't, and it's tested/ready to go. I'll implement that on further scripts.
- Note this is a one-shot script that will affect 983 pages. I would expect this to be an easy approval, and I'll run a trial first. tedder (talk) 05:08, 10 March 2010 (UTC)[reply]
Discussion
editI suspect this won't be of help, but this is the python regex I use to get link target and link text:
self.link_regex = re.compile("""
\[\[ # open [[
(?P<linktarget>[^\]\|]+) # target stops at ] or |
(?P<linktext>\|?[^\]]*) # maybe a |, with link text stopping at ]
\]\] # close ]]
""", re.VERBOSE)
The linktext allows me to know if there was a naked bar (striping namespace and parenthesis), a bar with link text or no bar at all. Josh Parris 05:19, 10 March 2010 (UTC)[reply]
- It certainly does help. I was thinking about unrolling the open/close brackets, but decided simpler is better and I'd just skip them altogether. tedder (talk) 05:24, 10 March 2010 (UTC)[reply]
- If you run into any protected pages, just make a list of them and I can go through them manually. There shouldn't be too many (if any) of them. ···日本穣? · 投稿 · Talk to Nihonjoe 09:44, 10 March 2010 (UTC)[reply]
- Actually, there weren't marked with the tag. I can give you a report of the "already-linked" list (~40, as I said to you previously) so you can verify all the links are in place. tedder (talk) 16:08, 10 March 2010 (UTC)[reply]
Given there haven't been any code changes, let's give this a whirl Approved for trial (30 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Josh Parris 01:16, 13 March 2010 (UTC)[reply]
- Okay, I realized the code wasn't complete- mainly, I didn't actually MAKE the change, I just got a regex ready for replacement. So I completely recoded it, and added code to make it handle more than one template usage on the same page. I ran it (more than once, actually) to narrow down a weird 'feature' (it never realizes the pages are the same, mostly due to the final character on the page). Ultimately, I'm not going to fix that for a oneoff- it'll try to make the change, and the wiki software rejects it because there aren't any changes. What's this mean? I'm fairly confident in the code, especially for a oneoff. The closest thing to an uncertain bug I've seen is this, which is a GIGO issue. Nihonjoe, can you verify the changes on Special:Contributions/TedderBot to anime pages are correct? tedder (talk) 05:40, 13 March 2010 (UTC)[reply]
- In my experience, if you strip trailing whitespace off the before and after page-text and compare them for equality and they're the same, then you can get around this problem. It took me six weeks and tens of thousands of edits to notice that the API was rejecting a lot of the bot's edits as 'no change'. Josh Parris 05:44, 13 March 2010 (UTC)[reply]
- Hey, that did it. Why didn't I think of using chomp()? tedder (talk) 05:52, 13 March 2010 (UTC)[reply]
- In my experience, if you strip trailing whitespace off the before and after page-text and compare them for equality and they're the same, then you can get around this problem. It took me six weeks and tens of thousands of edits to notice that the API was rejecting a lot of the bot's edits as 'no change'. Josh Parris 05:44, 13 March 2010 (UTC)[reply]
- Other than the newline removals you seemed to catch in some of its runs, it looks okay to me. ···日本穣? · 投稿 · Talk to Nihonjoe 06:20, 13 March 2010 (UTC)[reply]
- Nihon- would you be more comfortable if I ran it in batches- i.e., 100 at a time so you can check it? Or are you good with me running all of them? tedder (talk) 07:05, 13 March 2010 (UTC)[reply]
- You can run them however works best for you as long as you have a log page generated so they can be checked as needed. From what I've seen, though, I don't think there will be any problems. ···日本穣? · 投稿 · Talk to Nihonjoe 19:00, 15 March 2010 (UTC)[reply]
- Gotcha. So, we're ready to go, minus BRFA.. tedder (talk) 19:58, 15 March 2010 (UTC)[reply]
Approved. Josh Parris 02:49, 16 March 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.