Wikipedia:Bots/Requests for approval/VixDaemon
- The following discussion is an archived debate. Please do not modify it. Subsequent comments should be made in a new section. The result of the discussion was Approved.
Operator: KyraVixen
Automatic or Manually Assisted: Automatic
Programming Language(s): AWB
Function Summary: To finalize userbox migrations by bypassing redirects in an effort to help clear CAT:UBM
Edit period(s) (e.g. Continuous, daily, one time run): One time (As needed)
Edit rate requested: 6 edits per minute
Already has a bot flag (Y/N):
Function Details: The list of pages to modify will be gathered from the pages within CAT:UBM, and the actual list of userpages is what transcludes the pages as listed by Special:Whatlinkshere. The text to modify will be taken from the pages content (ie, the original template transclude code and the userfied code) and manually entered into the find/replace tool in AWB. If in the event the page does not contain the text to find and subsequently replace, no change will be made. Additionally, no other portion of the page will be touched. When AWB has gone through every page in the list, it will cease editing until it is reloaded.
Discussion
editDoes it handle {{babel}} boxes too? If so, it sounds good to me. —Mets501 (talk) 15:24, 30 December 2006 (UTC)[reply]
- As of now, no. As {{Babel}} parses the parameters to prefix them with User, so the template would force the transclusion to come from Template space even if the name of the box was modified in an attempt to transclude from userspace. By name I am referring to the blog portion of {{User:UBX/User blog}} for example. An example of the behavior that the find/replace string of "|browser:PrefersFirefox" with the source {{Babel|en|User:KyraVixen/Userboxes/browser:PrefersFirefox|de}} can be found here. As of the current moment, I am unaware if there is an escape mechanism for forcing a transclusion out of Template space, however I believe that would require a rewrite of the Babel template.
- As such, the logical thing to do would be to notify the users that use the template(s) in question that they need to be replaced by appending a note to the user's talk page; actually deleting information from a page and reinserting it in a different location is something that should be reserved for the users. I have tested {{Babel-N}} and it does not have the same limitation that the first Babel has, so if it were used, the bypass would succeed. If you have any other questions or comments, feel free to inquire. Kyra~(talk) 23:48, 30 December 2006 (UTC)[reply]
- Do you know python? I use the m:pywikipedia framework for my bot, MetsBot which works on templates with a lot of transclusions in CAT:GUS from time to time, and that fixes {{babel}} too. Suppose, for example, {{User American}} is moved to {{User:Mets501/Templates/American}}. Then {{babel|American}} can be replaced with {{babel|:Mets501/Templates/American}}. That is how it can be done. This can also be done (a bit harder though) in AWB with regexes. —Mets501 (talk) 06:53, 1 January 2007 (UTC)[reply]
- No, I do not know how to program in python. That is however an interesting trick to force a substitution out of template space when using Babel. Many thanks for that info, and I shall be sure to keep that in mind. And as for the replacement mechanism, I am currently just using string literals for the text to find. I am currently looking into learning how to use regexs, however. They seem like they would be quite useful to know how to use. Kyra~(talk) 09:20, 1 January 2007 (UTC)[reply]
- Do you know python? I use the m:pywikipedia framework for my bot, MetsBot which works on templates with a lot of transclusions in CAT:GUS from time to time, and that fixes {{babel}} too. Suppose, for example, {{User American}} is moved to {{User:Mets501/Templates/American}}. Then {{babel|American}} can be replaced with {{babel|:Mets501/Templates/American}}. That is how it can be done. This can also be done (a bit harder though) in AWB with regexes. —Mets501 (talk) 06:53, 1 January 2007 (UTC)[reply]
Approved. This bot shall run with a flag. You're welcome to use string literals, or you can use the following regexes:
Find | Replace |
---|---|
{{(U|u)ser A}} | {{User:B}} |
\|A | |:B |
where A is the second part of the original template (for example, for {{User American}} A would be American), and B is the new location of the template without "User" (for example, if {{User American}} was moved to {{User:Mets501/UBX/American}}, B would be Mets501/UBX/American). This will fix babel boxes as well as regular transclusions. —Mets501 (talk) 21:19, 1 January 2007 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. Subsequent comments should be made in a new section.