Forum:Bot Request

Everything About Fiction You Never Wanted to Know.

We've got a consistent markup error on a lot of works pages -- I've been finding it all over various anime and manga, but they're probably elsewhere as well. Basically, the image markup is wrapped in a quote box template, which results in the redlinked text "Template:Quote box". Here's an example from Iron Man (anime):

{{quote box|[[File:iron_man_1684.jpg|frame]]}}

Can we whomp up a bot to strip the template from around the file link? I sorta got into the zone last night doing it manually, but it's got to be on hundreds of pages, and fixing them would be better automated.

Oh, and there's one other thing we need to look for and fix. Some images, not a huge amount but a significant number regardless, have a path as part of their filenames. The one I know of for sure is "lt/", but I believe there are others. In the case I know of, well, it was my upload directory on the old TVT, made for me because I was the first prolific uploader of images for pages. I think there were a couple others before a generalized upload directory was implemented, but I'm not sure. We need to identify these and fix them, too. -- Looney Toons (talk) 14:13, 22 November 2013 (UTC)

Some errors like this may be tricky, like the "quote box" error. The picture and any captions are usually separated with their own template markup, so bot fixing this errors would be a challenge. As for the images, you may wish to speak with Vorticity. I could probably clean up any path goofs with a bot (or manually, if I had to), but you may wish to consult with him about which images those might be since he was the one who cobbled together the images for upload to Orain. GethN7 (talk) 16:59, 22 November 2013 (UTC)
I was afraid of that (the trickiness of botting the problem, I mean). As far as the path issue is concerned, the files were not put in subdirectories, they're all where they're supposed to be; it's just that the original markup had path info in it, and it got preserved in the import. -- Looney Toons (talk) 17:56, 22 November 2013 (UTC)
s/\{\{quote box\| \[\[File: (?: lt\/)? ([^\]]+) \]\] \}\}/[[File:$1]]/ig; Now I just need a place to apply that to the data. Vorticity (talk) 21:32, 22 November 2013 (UTC)
Can you tell I don't do regex? <sigh> -- Looney Toons (talk) 00:41, 23 November 2013 (UTC)