Wikipedia:WikiProject User scripts/Fulfilled requests
From Wikipedia, the free encyclopedia
This page contains requests for user scripts that have been recently fulfilled. To make a new request, please see Wikipedia:WikiProject User scripts/Requests. For older fulfilled requests, please see Wikipedia:WikiProject User scripts/Fulfilled requests/Archive index.
|
[edit] Easy Stubify
Can someone create a script similar to this that adds a stubify tab to the top of articles? Preferably, it would include a pop-up box that asks which stub type, add a summary, then automatically click the preview button at the bottom. Thanks, ~ thesublime514 • talk • sign 02:08, July 5, 2007 (UTC)
- Try User:Ais523/stubtagtab.js. --ais523 12:22, 6 July 2007 (UTC)
- Thanks, it works great ~ thesublime514 • talk • sign 18:48, July 6, 2007 (UTC)
[edit] Quicklink
Is there a script that could let me click a link in the toolbox or make a tab that would bring me down to a user's sandbox? If you really want to know why I want it I'll say, but it's embarrassing... YДмΔќʃʀï→ГC← 10-23-2007 • 23:38:52
- As a one-liner, you could use the following:
addPortletLink ('p-tb', location.href+'/Sandbox', 'Sandbox subpage');
- This may need to be customized depending on exactly what you want to do, though. --ais523 19:44, 2 November 2007 (UTC)
[edit] watch tab that adds images and/or templates of an article to watchlist
I'd like to request a script that would add a tab (or some other button) that could watchlist all images (and maybe templates) used in an article. A lot of images go unwatched for many articles. It would be great to be able to watchlist all of the images in an article in one click. -- Ned Scott 05:23, 5 February 2008 (UTC)
- I do not work with images, but as far as I know, you will not see deletions or new versions uploads in your watchlist. You will only be notified when someone changes the image description. Also, there doesn't seem to be a way for a script to add a Commons image to your watchlist. Adding templates to your watchlist is possible, however they might include other templates which are still not going to be watched by you ∴ AlexSm 17:30, 5 February 2008 (UTC)
-
- Yeah, I figured as much. While rare, I have seen some cases of image description page vandalism, and some test edits that have removed image tags and such. Deletion notices would also trigger the watchlist, as well as anything posted on the talk page. Most people probably wouldn't have a use for it, but it's something I've always kind of wanted. -- Ned Scott 07:23, 6 February 2008 (UTC)
-
-
- Another poke, would this even be possible? -- Ned Scott 07:39, 17 February 2008 (UTC)
-
- Here is something to tide you over until someone writes it for you in nice ajax.
- Should work, may be a bit buggy. Creates a textarea in your contentSub that you can copy to your raw watchlist. Someone else can create a queued ajax system that checks to make sure each template exists and each image is local and not on commons. --Splarka (rant) 10:19, 17 February 2008 (UTC)
-
- Awesome, thanks! -- Ned Scott 06:27, 28 February 2008 (UTC)
- MZMcBride and I had a thought on how you (or rather, whoever writes this) could check the list of images, for if they were local images or not with an intermediary api call. For example if you had Image:Wiki.png and Image:Bullet-blue.png as images in a page, an API call like:
/w/api.php?action=parse&format=json&callback=imagecommonscheck&text=[[:Image:Wiki.png]]+[[:Image:Bullet-blue.png]]
- and then a snippit to check it
function imagecommonscheck(obj) { var imagecheck = obj['parse'].links; for(var i=0;i<imagecheck.length;i++) { if(imagecheck[i].exists) { //this is only true if the image is not on commons, title is: imagecheck[i]['*'] } } }
/w/api.php?action=query&format=jsonfm&titles=Image:Albert%20Einstein%20Head.jpg|Image:Hitler_with_other_German_soldiers.jpg&prop=imageinfo
To verify:
function imagecommonscheck(obj) { var imagecheck = obj['query']['pages']; for(var i=0;i<imagecheck.length;i++) { if(imagecheck[i]['imagerepository'] == "local") { //this is only true if the image is not on commons, title is: imagecheck[i]['*'] } } }
Two new incentives for continued work on this request: one is that MediaWiki has been updated and deletions now show up on the watchlist, and two, I've doubled the bounty on this request from $20 to $40. -- Ned Scott 03:29, 17 April 2008 (UTC)
- And new versions of images too. Also, if it makes it easier, a script that works with just images and not templates would be sufficient for this request. -- Ned Scott 05:53, 18 April 2008 (UTC)
Test this out: User:Splarka/watchimages.js. It is not fully automated though. What it does:
- On a content page, it adds a toolbox button.
- If clicked it queries the API for all images.
- It checks which are local vs commons, which exist, which have description pages.
- Currently selects local or missing images (with or without pages) not on commons.
- Sends you to Special:Watchlist/raw with the pages as a URI parameter
- Appends these to the textarea, alerts you.
- You then either choose to update, edit, or do nothing.
- Upon save, it returns you to the page.
Of course, it could be streamlined a bit more. It could be automated, have more logic (check if page has images, check if images are repeats on watchlist, filter out logos, etc). Also, it specifically does not use ajax at this time (ajax POST is annoying), but should be good enough to test. --Splarka (rant) 06:48, 24 April 2008 (UTC)
-
- Awesome! Even this alone is a huge help, and is probably enough to make claim to the donation bounty. Thanks Splarka! -- Ned Scott 03:32, 25 April 2008 (UTC)
- A part of the bounty process is to credit those who worked on the task (the bounty hunters). Here's what I have for the donation public comment "
en:WP:BOUNTY on image watchlist user script en:user:Splarka/watchimages.js . Major thanks to en:user:Splarka ! Also thanks to en:user: MZMcBride, Superm401, and AlexSm, in discussion.
" - Obviously Splarka is in there, and since there was room I also included all the names in this thread. Are there any names I should add or remove? -- Ned Scott 03:48, 25 April 2008 (UTC)
- Well, I went ahead and made the donation, though I was hopping to link to the public comment, I can't seem to figure out how (or where it is displayed). In any case, thank you again for the work on this, and I look forward to seeing how the script develops :D -- Ned Scott 07:53, 26 April 2008 (UTC)
- A part of the bounty process is to credit those who worked on the task (the bounty hunters). Here's what I have for the donation public comment "
- Awesome! Even this alone is a huge help, and is probably enough to make claim to the donation bounty. Thanks Splarka! -- Ned Scott 03:32, 25 April 2008 (UTC)
[edit] Quickly add a new category
I am requesting a script that would add a link when viewing an article. When clicked on, it will show a JavaScript prompt, requesting for a Category to add to the current article; when one is entered and OK is hit, then the category will be added to the article. Gary King (talk) 07:02, 17 February 2008 (UTC)
- User:ais523/cattab.js is a start at this. It works, but it's a bit rudimentary; it always puts the category at the start of the article's category list (or at the end of the article if it doesn't have a category list), and doesn't handle sortkeys. --ais523 12:59, 25 February 2008 (UTC)
- You may want to try MediaWiki:Gadget-HotCat.js. Superm401 - Talk 01:49, 25 April 2008 (UTC)
[edit] highlight links to disambiguation ("dab") page
Links to redirects are faintly annoying, but links to dab pages are a fatal error. Anybody wanna do this? Ling.Nut (talk) 15:36, 5 April 2008 (UTC)
- See Wikipedia:WikiProject Disambiguation. Fixing disambig links is usually not a task that can be handled automatically, and there are no JavaScript tools that I know of which can assist in fixing links (although some programs can do this, notably AWB). What specifically are you requesting: a script to highlight disambig links on a given page, a script to fix links to a given disambiguation page (e.g., those listed at Wikipedia:Disambiguation pages with links/Maintenance), or something else? GracenotesT § 01:09, 6 April 2008 (UTC)
- I'm asking for whatever is doable. :-) If a script can fix them, that would be best. If no script can fix them, then a script that merely hightlights them (not in green; the redirect script already uses that color) would be a huge step in a good direction. Thanks! Ling.Nut (talk) 10:56, 6 April 2008 (UTC)
- See immediately above, and PS here note esp. that I'm looking to identify the links on a given article that go to dab pages. I think CorHomo already has the ability to fix the list of articles that link to a given dab page. I also think WP:AWB has only that same ability, am I correct? But if you have a long article... find dab links could be very tedious.. Ling.Nut (talk) 11:02, 6 April 2008 (UTC)
- Not all links to disambiguation pages are invalid, although I will agree that many are. Anyway, just for fun, I wrote a disambiguation finder: User:Splarka/dabfinder.js ... note that it does take a few seconds for longer pages to make the necessary API calls. It is still rough, all it does is hilight them on the page for you, and alert you when done. It is rather complex code of several layers of iteration, but basically it: checks which templates are disambiguation templates, checks what links on the page link to pages that contain one of these templates, and then hilights all these matched links on the page itself. You can test it with
importScript('User:Splarka/dabfinder.js');
in your user js. Click on the portlet link in the toolbox (on any content page), and then wait a few seconds. --Splarka (rant) 10:33, 7 April 2008 (UTC)
- Not all links to disambiguation pages are invalid, although I will agree that many are. Anyway, just for fun, I wrote a disambiguation finder: User:Splarka/dabfinder.js ... note that it does take a few seconds for longer pages to make the necessary API calls. It is still rough, all it does is hilight them on the page for you, and alert you when done. It is rather complex code of several layers of iteration, but basically it: checks which templates are disambiguation templates, checks what links on the page link to pages that contain one of these templates, and then hilights all these matched links on the page itself. You can test it with
- See immediately above, and PS here note esp. that I'm looking to identify the links on a given article that go to dab pages. I think CorHomo already has the ability to fix the list of articles that link to a given dab page. I also think WP:AWB has only that same ability, am I correct? But if you have a long article... find dab links could be very tedious.. Ling.Nut (talk) 11:02, 6 April 2008 (UTC)
- I'm asking for whatever is doable. :-) If a script can fix them, that would be best. If no script can fix them, then a script that merely hightlights them (not in green; the redirect script already uses that color) would be a huge step in a good direction. Thanks! Ling.Nut (talk) 10:56, 6 April 2008 (UTC)
(undent) Thanks! I tested it out on a couple articles, and it seems to do a great job of catching different types of dab page templates. A million thanks! Ling.Nut (talk) 13:18, 7 April 2008 (UTC)
[edit] Categorizing links
[edit] Hiding categorized links
After visiting a Wikipedia link, that link changes color from blue to purple on my computer screen. To tag pages with categories, I've been opening all the pages at Category:NA-Class articles, for example, to turn the links purple. Then I use the All pages with prefix. Those pages for which the link still is blue need a Category:NA-Class category tag. It takes a lot of time to initially open all the pages within a particular category to turn the link from blue to purple. Is there a way to change the colors of the links in Category:NA-Class articles as the appear on my computer screen without having to visit each of the links? I tried editing my temporary internet file (browser history) and tried using the 'Print all linked documents' option of windows print feature to printing to a file (that I then deleted). I wasn't able to edit my temporary internet file (browser history) and the 'Print all linked documents' option didn't result in making the category links purple. Can you create me a script that causes all the links on a page (e.g. Category:NA-Class articles) to change color to show that I visited the page (without actually opening the linked page)? I am open to other methods as well. Thanks. GregManninLB (talk) 16:10, 17 April 2008 (UTC)
- If I understand correctly, you need to exclude members of the 1st list form the 2nd list. I suggest using "other methods", which in this case is supposed to look like this:
- you open Special:PrefixIndex/Category:Non-article
- you start the script
- the script asks you for a category name, you enter «NA-Class articles»
- script queries API to get all category members
- script hides all returned titles from the current page
- Splarka sure can do it, or I could do it if he doesn't have time at the moment. Let's wait for his answer then. —AlexSm 16:50, 17 April 2008 (UTC)
-
- Someone called my name? Hmm. I think this does what AlexSm described: User:Splarka/cmlhider.js ... Not highly tested, and rather highly specific, and it is very slow, you may think your browser is locked up (takes about 10 seconds on mine for 227 category members * 559 links). But give it a shot. You can copy it to your Special:Mypage/monobook.js user js, or add:
importScript('User:Splarka/cmlhider.js');
to test it directly. --Splarka (rant) 09:12, 18 April 2008 (UTC)- Hi Splarka. I added User:Splarka/cmlhider.js to my monobook. I logged off and then logged back in. I then opened Special:PrefixIndex/Category:Non-article. However, Special:PrefixIndex/Category:Non-article still is displaying those categories already tagged with Category:NA-Class articles. Got any idea where I messed up? GregManninLB (talk) 15:09, 18 April 2008 (UTC)
- You're supposed to click on a new link «Hide links» on the left (in the «toolbox» portlet) to actually start the script. To Splarka: 1) should have used «p-cactions»; 2) how about
categorymembers ... join('|')
and then using indexOf? might speed things up a little. —AlexSm 15:24, 18 April 2008 (UTC)- Thanks for the tip (which fixed my problem). I then tagged all the pages. However, even after clicking on the new link «Hide links» to excluded Category:NA-Class articles categories, Special:PrefixIndex/Category:Non-article still is displaying a few stubborn categories tagged with Category:NA-Class articles. Is it possible to tweek the script to exclude these as well? GregManninLB (talk) 20:35, 18 April 2008 (UTC)
- You're supposed to click on a new link «Hide links» on the left (in the «toolbox» portlet) to actually start the script. To Splarka: 1) should have used «p-cactions»; 2) how about
- Hi Splarka. I added User:Splarka/cmlhider.js to my monobook. I logged off and then logged back in. I then opened Special:PrefixIndex/Category:Non-article. However, Special:PrefixIndex/Category:Non-article still is displaying those categories already tagged with Category:NA-Class articles. Got any idea where I messed up? GregManninLB (talk) 15:09, 18 April 2008 (UTC)
- Someone called my name? Hmm. I think this does what AlexSm described: User:Splarka/cmlhider.js ... Not highly tested, and rather highly specific, and it is very slow, you may think your browser is locked up (takes about 10 seconds on mine for 227 category members * 559 links). But give it a shot. You can copy it to your Special:Mypage/monobook.js user js, or add:
[edit] Catgory text string index
Special:PrefixIndex allows a user to display pages beginning with a particular prefix, such as categories beginning with "Non-article". Is there a way ( would you write me a script) to display pages containing a particular text string, such as categories containing "Non-article". This would allow me to find categories such as Category:WikiProject Biography non-article pages where "non-article" appears other than at the beginning of the category name. Thanks. GregManninLB (talk) 07:02, 24 April 2008 (UTC)
- Try title grep. That isn't feasable as a userscript. --Splarka (rant) 07:13, 24 April 2008 (UTC)
- Thanks. I followed up here. GregManninLB (talk) 14:04, 24 April 2008 (UTC)
- User:Nikola Smolenski improved wikimedia grep to search categories with regular text. Thanks again for the lead. GregManninLB (talk) 14:28, 27 April 2008 (UTC)
- Thanks. I followed up here. GregManninLB (talk) 14:04, 24 April 2008 (UTC)