Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Tales from Chyria
Search
Editing
Module talk:InfoboxImage
(section)
From Tales from Chyria
Namespaces
Module
Discussion
More
More
Page actions
Read
Edit source
New topic
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Bot to clear category=== I wrote a simple 1-line bot to clear the category. Here are instructions, so anyone may run it in future. The main requirement is you have an account with a bot flag; keys for OAuth consumer-only; and you can use Unix. {{collapse top|Bot to clear tracking category}} <pre> 1. git clone https://github.com/greencardamom/Wikiget 2. Edit wikiget.awk and add your OAuth consumer-only keys at the top of the file. See the file "EDITSETUP" for instructions on how to get OAuth consumer-only keys 3. Download the library.awk file eg. wget -q -O- 'https://raw.githubusercontent.com/greencardamom/BotWikiAwk/master/lib/library.awk' > library.awk 3. Get the list of pages to process eg. wikiget.awk -c "Pages using infoboxes with URL in image parameter" > cat.auth 4. Run this 1-line awk command: awk -ilibrary 'BEGIN{IGNORECASE=1; re="(image(_(skyline|name|map))?|signature|crest|flag|photo|patch|picture|cover|logo)[ ]*[=][ ]*"; res="[[]http[^]]*[]]"; reb="http[^|{\n]*[^|{\n]*"; rew="(wikipedia|wikimedia)"} {print $0; f=sys2var("wikiget.awk -w " shquote($0)); fo=f; c=patsplit(f,field,re res,sep); for(i=1;i<=c;i++) { match(field[i],res,e); if(e[0] ~ rew) {command = $0 " ---- Wikipedia link ---- " e[0]; print command >> "cat.log"; stdErr(command); continue}; print field[i]; field[i] = subs(e[0], "", field[i]); print field[i]; print $0 " ---- " e[0] >> "cat.log" }; f = unpatsplit(field,sep); c=patsplit(f,field2,re reb,sep2); for(i=1;i<=c;i++) { field2[i] = strip(field2[i]); match(field2[i],reb,e); if(e[0] ~ rew) {command = $0 " ---- Wikipedia link ---- " e[0]; print command >> "cat.log"; stdErr(command); continue}; print field2[i]; field2[i] = subs(e[0], "", field2[i]); print field2[i]; print $0 " ---- " e[0] >> "cat.log"}; f = unpatsplit(field2,sep2); if(fo==f) {command = $0 " ---- None found"; print command >> "cat.log"; stdErr(command)} else {print f > "cat.article"; close("cat.article"); command = "wikiget.awk -E " shquote($0) " -S " shquote("Remove errant Infobox image URL(s) per [[Module_talk:InfoboxImage#List_of_URLs_to_be_removed|discussion here]]") " -P cat.article"; print command; print sys2var(command) } }' cat.auth That's it. It will produce logs to the screen and to the file cat.log </pre> {{collapse bottom}}
Summary:
Please note that all contributions to Tales from Chyria may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Chyria Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs