Jump to content

Wikipedia talk:User scripts

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by BDavis (WMF) (talk | contribs) at 17:36, 8 November 2021 ("Same as the above" style descriptions are not ideal: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconWikipedia Help NA‑class Low‑importance
WikiProject iconThis page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
NAThis page does not require a rating on the project's quality scale.
LowThis page has been rated as Low-importance on the project's importance scale.
WikiProject iconJavaScript NA‑class
WikiProject iconThis page is within the scope of WikiProject JavaScript, a collaborative effort to improve the coverage of articles related to JavaScript, and to the development of user scripts for use on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
NAThis page does not require a rating on Wikipedia's content assessment scale.

Reusing this data in Toolhub

I have built a tool that parses the wikitext of Wikipedia:User scripts and generates a toolinfo.json document which can be used by Toolhub, Hay's Directory, and other toolinfo consumers. As a result, there are now almost 600 user scripts newly documented by the Toolhub demo server.

Thank you to Nardog for Template:User script table row and to everyone else who has used it to document their scripts at Wikipedia:User scripts/List. --BDavis (WMF) (talk) 15:47, 23 August 2021 (UTC)[reply]

Edit summary

Hi, my script (a simple fork of Writ Keeper's) doesn't seem to add an edit summary when editing pages, though it does when creating them (see here). ― Qwerfjkltalk 19:43, 1 September 2021 (UTC)[reply]

@Qwerfjkl Hi. First of all, you may use beautifier.io (or other code beautifiers found by a google search) to beautify your code and make it more readable.
I'm not an expert, but as i can see on mw:API:Edit, when you set section parameter together with summary parameter (as you did in requestData2 variable), the value passed to summary will be used as the section title (as seen in the diff you provided). you can use appendtext instead and provide some text strings as its value. something like appendtext" sectionTitle + [a variable containing the Talkback template and its parameter values] is a good value for this parameter. So you have to replace section: 'new' with appendtext: talkBackMessage where talkBackMessage is what is going to be appended to the bottom of the user's talk page. As i am not a Javascript expert (just a fan, coding for fun), test it and let me know if it works. Jeeputer (talk) 11:00, 24 September 2021 (UTC)[reply]
I think that worked. ― Qwerfjkltalk 12:14, 26 September 2021 (UTC)[reply]
@Qwerfjkl: Glad to hear that. :) Jeeputer (talk) 12:42, 26 September 2021 (UTC)[reply]

Documentation update

Hi. Looks like Wikipedia:User_scripts#How_do_you_add_new_scripts_to_the_scripts_list? needs to be updated based on the new list layout. Jeeputer (talk) 11:07, 24 September 2021 (UTC)[reply]

Done. Thanks for noting this. Nardog (talk) 23:38, 26 September 2021 (UTC)[reply]

Should we recommend script-installer?

Right now all the installation instructions use the manual method. script-installer is pretty simple, though... maybe we should just point people towards that? Enterprisey (talk!) 06:42, 28 September 2021 (UTC)[reply]

Yes. – SD0001 (talk) 11:32, 28 September 2021 (UTC)[reply]
I've thought about removing the installation instructions from the list altogether. As much as I do prefer the new layout, the instructions stick out like a sore thumb (as did they in the old layout). While we're at it, I wish script-installer didn't rely on IDs (see User talk:Enterprisey/script-installer#id vs data-). Nardog (talk) 12:16, 28 September 2021 (UTC)[reply]
Yes those "How to install" links are atrocious. It's better to generalize the installation instructions, rather than include it for every script. – SD0001 (talk) 15:46, 28 September 2021 (UTC)[reply]
Absolutely. There's no reason for people to be mucking about editing js files by hand. The more standardized and automated you can make this, the better. -- RoySmith (talk) 16:04, 28 September 2021 (UTC)[reply]
@Enterprisey @Nardog @RoySmith @SD0001 I think script installer can been run from the documentation page with a link like https://en.wikipedia.org/wiki/Wikipedia_talk:User_scripts.js?withJS=MediaWiki:Gadget-script-installer.js[1], which doesn't require script installer to be installed. ― Qwerfjkltalk 18:33, 28 September 2021 (UTC)[reply]
Very true; I think recommending that people actually install script-installer would still be helpful, because of course it allows them to easily uninstall and otherwise manage the scripts. Enterprisey (talk!) 07:24, 29 September 2021 (UTC)[reply]

References

  1. ^ The actual link is https://en.wikipedia.org/wiki/{{FULLPAGENAMEE}}.js?withJS=MediaWiki:Gadget-script-installer.js

 Done. Nardog (talk) 00:47, 29 September 2021 (UTC)[reply]

Should we remove the "total" or "active" column?

I don't think we need two columns saying how many people have this installed. Maybe we only need the "active" one? Enterprisey (talk!) 00:27, 30 September 2021 (UTC)[reply]

"Same as the above" style descriptions are not ideal

There are a number of descriptions written with some variation of "same as the above" / "see above" / "like the above" which presumes that the linear list organization of the current page is static (or at least consistently ordered) and that records will not be copied individually to other locations. The introduction of the toolinfo.json scraper for this data breaks that assumption. I would like to suggest that folks update their descriptions to be somehow less dependent on reading order. Each case will of course be slightly different, but one typical solution could be to replace the "above" mentions in descriptions with the names of the scripts being extended or adapted to new use cases. --BDavis (WMF) (talk) 17:36, 8 November 2021 (UTC)[reply]