Wikipedia:User scripts/Requests/Archive 7
![]() | This is an archive of past discussions on Wikipedia:User scripts/Requests. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current main page. |
Archive 1 | ← | Archive 5 | Archive 6 | Archive 7 | Archive 8 | Archive 9 |
User talk page warning to flag up likely THEYCANTHEARYOU problem
(I asked at VPT and was signposted here, so am just copypasting my original query:)
While waiting (!) for the mobile user notification problem (WP:THEYCANTHEARYOU) to be one day maybe (!!) fixed, would it be a) possible and b) good idea to implement in the meantime a warning which automatically appears on the top of the user talk page of a user who is likely to be not getting notifications (ie. edits only or or mostly on an affected mobile device, and does not edit their talk page)?
I realise this would do nothing to help such users receive the said notifications, but it would at least make it easier for the rest of us to identify this as a possible explanation for their lack of response to warnings etc., helping to AGF and not raise blood pressures unduly. I've seen many user talk pages where the attempts at communicating with the user get increasingly desperate, until someone points out this as the likely reason. I just thought maybe that could be done automatically by way of some clever code.
Thanks, -- DoubleGrazing (talk) 11:58, 2 May 2022 (UTC)
- PS: By "automatically" I meant some sort of user-side script which I could opt in and put in my common.js or somewhere. When I then visit a user talk page, the script checks the user's edit history and displays (to me) a warning, flagging up things like 'user has never edited their user talk page' or 'user edits using iOS devices only', or whatever the relevant criteria are. -- DoubleGrazing (talk) 11:59, 2 May 2022 (UTC)
- @DoubleGrazing: I have a script that might do part of what you are looking for: User:Rummskartoffel/talk page usage.js, which displays the time since a user's last edits in certain talk namespaces, along with links to those edits and links to their contributions for the namespaces in question. It doesn't do the other things you're looking for, though. Rummskartoffel 17:55, 8 May 2022 (UTC)
- Thanks @Rummskartoffel, will keep that in mind. Best, -- DoubleGrazing (talk) 06:08, 9 May 2022 (UTC)
Date Format Converter
I would like to suggest a Javascript extension that changes date formats from 1977-01 to January 1977. I am editing articles on Arc Routing and Mixed Chinese postman problem and the book uses the date format yyyy-mm and I would like to automate the process of correctly formatting the dates to month name long yyyy. ScientistBuilder (talk) 19:37, 10 May 2022 (UTC)
- I suggest using
{{subst:#time:F Y|1977-01}}
, which converts to "January 1977" when you save. Nardog (talk) 21:58, 10 May 2022 (UTC)
User script to Grab Youtube, Facebook, and Twitter links from a Wiki Page
Simple. Just grab and take the URls/links from a Wikipedia page with websites from Youtube, Facebook, and Twitter. Any additional sites can be good but these three should be primary. I am thinking of storing and saving them a copy before being deleted or anything bad can happen. Can anyone create an automated userscript for this? Thank you --Likhasik (talk) 16:53, 12 May 2022 (UTC)
Doing...... Shouldn't take long. Chlod (say hi!) 16:56, 12 May 2022 (UTC)
- Hi lods. Thank you for this. Well, I would say that I am an archivist and I would like to request an automation for sending links to archive.today and ghostarchive.org - both of which save webpages. Probably an extension after grabbing the URLs, then sending them to the archival sites, if possible. Thank you for the initiative. Let me know and please do ping me with "@" --Likhasik (talk) 17:06, 12 May 2022 (UTC)
- @Likhasik: Userscipt can be found at User:Chlod/Scripts/LinkGrab.js. By default, this adds a button to the "More" menu (at the page header) that will copy links to YouTube, Facebook, and Twitter to your clipboard. To change the websites that are copied, place the following before the
importScript
ormw.loader.load
line in for the script in your common.js file. window.lgLinksToFind = [ // Default "youtube.com", "youtu.be", "facebook.com", "twitter.com", // Example: Also copy links to the Washington Post "washingtonpost.com" ]; importScript("User:Chlod/Scripts/LinkGrab.js");
- Let me know if you want anything changed or need anything else. I'll definitely expand this in the future to give it a better interface for choosing websites to get than having to edit the JS file. As for the extension that automatically archives the links: it's beyond the scope for this board (and probably needs more than a userscript, as I don't think either website would allow cross-origin resource sharing with Wikipedia). We do, however, have User:InternetArchiveBot (interface) that can automatically archive outlinks to the Internet Archive (as long as the option was set). Chlod (say hi!) 17:46, 12 May 2022 (UTC)
- @Chlod Can you also please add a "false positive" feedback box (I'm not sure with the name) whenever I click Grab links? Like for example, an article without any of those URLs/Websites. If I click "Grablink", it should give me feedback that there are no links corresponding to it (No YT/FB/Twitter links). Hence not wasting my time confirming if I have the links grabbed.
- Whenever I click grab links, the feedback box shows "Links copied to clipboard" but there are no links copied instead. I just wanted to save time instead of CTRL+V-ing every time to see if there is something copied.
- Also, can you also create a userscript that whenever I click "random article", it will lead me to my preferred topics? I am tired seeing sports articles whenever I click random article which I do not want to edit. Thank you.
- --Likhasik (talk) 03:31, 13 May 2022 (UTC)
- @Likhasik: For the former,
Done. For the latter, you may wish to use Special:RandomInCategory and bookmark that instead. Chlod (say hi!) 04:29, 13 May 2022 (UTC)
- Please also add the total numbers of link copied. Better if by Links/URLs themselves with the overall count, of course. (Example: 5 YT links copied; 0 FB links; 2 Twitter etc.) Only for the feedback box
- Also, is there a possibility that I can edit this userscript by myself with my own preferences and Links? Sorry I am new in using a Userscript. Thanks! --Likhasik (talk) 04:42, 13 May 2022 (UTC)
- @Likhasik: Feel free to copy over the userscript to your own userspace (subject to WP:CWW, of course). After that, just change the relevant lines in your
common.js
to use your own version. Chlod (say hi!) 04:45, 13 May 2022 (UTC)- Okay then. Also, please do add the aforementioned request. The number of copied links per site. Thank you --Likhasik (talk) 05:16, 13 May 2022 (UTC)
- @Likhasik:
Done.
Chlod (say hi!) 05:28, 13 May 2022 (UTC)
- @Chlod Hello and good day. I think the script is broken. It copies links that are not any of those three. It just takes any URLs in the page, including files and images within wikipedia. Please fix. The feedback box is not even cooperating and I'd say still faulty. --Likhasik (talk) 03:20, 15 May 2022 (UTC)
- @Likhasik: Looks like I missed a pair of brackets. Should be fixed now. Chlod (say hi!) 03:35, 15 May 2022 (UTC)
- @Chlod Hello and good day. I think the script is broken. It copies links that are not any of those three. It just takes any URLs in the page, including files and images within wikipedia. Please fix. The feedback box is not even cooperating and I'd say still faulty. --Likhasik (talk) 03:20, 15 May 2022 (UTC)
- @Likhasik:
- Okay then. Also, please do add the aforementioned request. The number of copied links per site. Thank you --Likhasik (talk) 05:16, 13 May 2022 (UTC)
- @Likhasik: Feel free to copy over the userscript to your own userspace (subject to WP:CWW, of course). After that, just change the relevant lines in your
- @Likhasik: For the former,
- @Likhasik: Userscipt can be found at User:Chlod/Scripts/LinkGrab.js. By default, this adds a button to the "More" menu (at the page header) that will copy links to YouTube, Facebook, and Twitter to your clipboard. To change the websites that are copied, place the following before the
- Hi lods. Thank you for this. Well, I would say that I am an archivist and I would like to request an automation for sending links to archive.today and ghostarchive.org - both of which save webpages. Probably an extension after grabbing the URLs, then sending them to the archival sites, if possible. Thank you for the initiative. Let me know and please do ping me with "@" --Likhasik (talk) 17:06, 12 May 2022 (UTC)
Translation script
Hello! I sometimes use Wikipedia to help myself learn new languages. To do that, many times I have to look up in Google certain words from certain sentences to be able to grasp the context. Can we create a script that makes it possible to select a certain word and get the translation for it in a chosen language? For example, in the Latin Wikipedia, in the sentence Novum Eboracum est urbs. (New York is a city.) I can select "urbs" and get shown a tooltip reading "city". Maybe the language of the source gets deducted automatically by the project's name code and the translated language can be set up as a preference by the user somewhere. (Or we can just make it work with English if that's too hard, that would be good enough.) - Klein Muçi (talk) 03:28, 15 April 2022 (UTC)
- There are plenty of browser extensions that allow that on any website, see [1][2]. Nardog (talk) 03:42, 15 April 2022 (UTC)
- Hah, somehow it had never crossed my mind it could be that easy. Precisely what I was looking for, thank you! - Klein Muçi (talk) 09:21, 15 April 2022 (UTC)
- There's also Endo999's GoogleTrans, which can also be enable as a gadget from your preferences page. — Guarapiranga ☎ 06:05, 15 May 2022 (UTC)
- @Guarapiranga, superb script (and superb support from Endo for more than a decade apparently). I'm sticking to the extension for the moment because it can extend further than Wikipedia but if I hadn't been told about it, I would have gone with this script. Thank you! - Klein Muçi (talk) 11:04, 15 May 2022 (UTC)
A script that highlights and helps link unlinked people (and organisations?) in articles
... somewhat similar to those that highlight dab links and help resolve them.
Unfortunately WP:REDLINK policies create a dis-incentive for editors to wikilink people whose notability is uncertain, or that may or may not become notable in the future. The result I see is tons of people who were deemed notable enough to have articles in their name, but that remain (sort of) anonymous in other articles, probably bc they were written before their notability was established. It'd be great if a script could highlight such people (perhaps by simply regexing for proper names, e.g. ([A-Z][a-z\-]+ [A-Z][a-z\-\.]+
, and checking whether their articles exist. The script could then provide the hover snippet of the article with a confirm button to introduce the link. If the linked page is a dab, then if it could help choose the dab link from a dropdown menu, that'd be a bonus.
Is there anything already out there that doesn something like that? Otherwise, I can't imagine it'd be too hard to put it together (I can probably do it, given enough time, sweat and tears). — Guarapiranga ☎ 06:00, 23 May 2022 (UTC)
- How would a script recognize that in "James Wood is a 65-foot tall carpenter", "James Wood" is a person that could potentially be linked, and "tall carpenter" isn't a person that could potentially be linked? Headbomb {t · c · p · b} 06:04, 23 May 2022 (UTC)
- For reference, your regex would highlight the following (in purple). That doesn't seem very useful. Headbomb {t · c · p · b} 06:15, 23 May 2022 (UTC)
- Looks like you figured out how that regex can distinguish James Wood from tall carpenter, Headbomb. But, yeah, it's e.g.; sure it can be improved (to include longer and hyphenated proper names, for instance). I wouldn't have the script simply link all such capitalised groups of words--let alone highlight'em in purple! 😄--but rather underline them (say, in blue), perhaps highlight them in light blue when hovered over, and open a drop down menu with options to either link or ignore them (perhaps a more complete menu would include: link this, link all, ignore this, ignore all, and the alternatives to link to in case of dab). — Guarapiranga ☎ 22:40, 23 May 2022 (UTC)
- For reference, your regex would highlight the following (in purple). That doesn't seem very useful. Headbomb {t · c · p · b} 06:15, 23 May 2022 (UTC)
Disambiguation gadget from plwiki
The plwiki has a disambiguating gadget to help clean up ambiguous links on a page. The original script is Matma Rex's disFixer on enwiki. The interface works fine, but it doesn't seem to apply the requested changes once the edit window is loaded (at least on my setup). Has anyone been able to make it work, or have an alternate? Cheers. — Guarapiranga ☎ 05:01, 25 May 2022 (UTC)
- @Guarapiranga Hi :) I haven't maintained the enwiki version, because I thought that other tools for fixing disambiguation links are popular here – for example Navigation popups does it, and tons of people have that enabled. I haven't looked at it since 2014, it may have been broken by some MediaWiki changes in the meantime. If you'd find it useful, I'll have a look at it tomorrow. There are some differences from the plwiki version, since that one depends on some other gadgets available there. Matma Rex talk 00:03, 26 May 2022 (UTC)
- Aha! I hadn't noticed navpopup had that option. Thanks, Matma Rex. I guess that's also half the solution to an earlier question I had posted here. Cheers. — Guarapiranga ☎ 02:14, 27 May 2022 (UTC)
- Hum... Navpopup's dab option is not working for me either (and showing very similar behaviour to your script, Matma Rex--it opens the edit window with the
autoedit
regex in the url, but no changes are made in the content--which suggests to me in both cases it may be a conflict with my config (preferences, gadgets and scripts)). — Guarapiranga ☎ 02:42, 27 May 2022 (UTC)- @Guarapiranga Oh, this might actually be a simpler problem than I thought. Do you have syntax highlighting enabled? This change should fix it: [3]. Someone could probably make a similar fix to Popups. (Also, I'd like to note that this gadget is 10+ years old and not my finest work. I'll be happy if you find it useful, but it might be a disappointment, and I'm not really interested in reworking it.) Matma Rex talk 23:19, 27 May 2022 (UTC)
- Thanks for that, Matma Rex. Neither of those solutions fixed it, though. It's now pretty clear to me this is unrelated to your script, navpopup, or my setup (as simply loading the autoedit url does nothing to the edit window whether I'm logged in or out). This one, for instance. — Guarapiranga ☎ 04:07, 28 May 2022 (UTC)
- @Guarapiranga Oh, this might actually be a simpler problem than I thought. Do you have syntax highlighting enabled? This change should fix it: [3]. Someone could probably make a similar fix to Popups. (Also, I'd like to note that this gadget is 10+ years old and not my finest work. I'll be happy if you find it useful, but it might be a disappointment, and I'm not really interested in reworking it.) Matma Rex talk 23:19, 27 May 2022 (UTC)
- Hum... Navpopup's dab option is not working for me either (and showing very similar behaviour to your script, Matma Rex--it opens the edit window with the
- Aha! I hadn't noticed navpopup had that option. Thanks, Matma Rex. I guess that's also half the solution to an earlier question I had posted here. Cheers. — Guarapiranga ☎ 02:14, 27 May 2022 (UTC)
Userscript to periodically reload web.archive.org whenever I am archiving
Hello and I ask you folks if maybe you can help me out. Pardon me if this request is an external one, outside of Wikipedia itself.
So I have this Userscript executor called Tampermonkey which is a chrome extension and unfortunately I cannot code it myself.
Whenever I archive or send links to save in web.archive.org, I get this message "Sorry Job failed" or "Sorry You have already reached the limit of active sessions. Please wait for a few minutes and then try again." I usually archive links manually here in Wikipedia because the InternetArchiveBot is sometimes inefficient when it comes to a lot of requests, as well as personal sites that I visit in the web in general. After several reloads, it accepts the request and successfully archive. I would like just to request if you know or can create a code which automatically reloads the web.archive.org website whenever I am saving to save time instead of revisiting each and reloading it one-by-one. Not automatically but rather within a certain period or with a cooldown for a few seconds a bit.
Thank you and have a great day! --Likhasik (talk) 05:22, 28 May 2022 (UTC)
- @Likhasik: this Tampermonkey script will reload any page under web.archive.org/* after a set amount of time:
- >>> Ingenuity.talk(); 19:59, 28 May 2022 (UTC)
// ==UserScript== // @name Reload web.archive.org // @namespace http://tampermonkey.net/ // @version 0.1 // @description reload web.archive.org // @author You // @match https://web.archive.org/* // @icon https://www.google.com/s2/favicons?domain=tampermonkey.net // @grant none // ==/UserScript== const reloadTime = 15000; // you can change this value to vary how long it will take to reload -- this is 15 seconds window.setTimeout(() => location.reload(), reloadTime);
Point 1st tab to ROOTPAGENAME
I'm always a little confused as to why the 1st tab--Article in mainspace, Template, Project page, etc--while in a talk or subpage point to {{SUBJECTPAGENAME}}, not to {{ROOTPAGENAME}}. Scripting that change should be easy enough; has anyone done it already, or should I endeavour to? Or would anyone like to take a stab at it? — Guarapiranga ☎ 02:39, 31 May 2022 (UTC)