Wikipedia:User scripts/Requests/Archive 8
![]() | 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 5 | Archive 6 | Archive 7 | Archive 8 | Archive 9 |
Script that facilitates fixing citation problems
Hello! Most of my time in my home wiki these days is spent fixing citation problems. The usual procedure for me is like this: Go to Category:CS1 (well, the Albanian homologue of it), choose a sub-category, choose a page, go to its bottom, check the ref-section, find the problem, click the little arrow to get sent to the corresponding text portion, memorize the sentence where the reference is, click "edit", CTRL+F for the memorized sentence, fix the error, save, repeat.
Doing tens of fixes per day becomes a bit time consuming so I was wondering if something can be done so that it would allow me to remove some of the steps above. What I'm actually hoping for is a script that allows me to actually press edit right in the ref-section and be sent to the corresponding text portion with the said reference highlighted. Ideally there should also be another highlighting color highlighting the parameter (and its corresponding value) that actually needs fixing but I'd be happy even without that. - Klein Muçi (talk) 11:36, 24 June 2022 (UTC)
- Not exactly the specific solution you had in mind, but have you looked into BrandonXLF/ReferenceExpander.js, Citation expander or ProveIt? They make many standard ref corrections. — Guarapiranga ☎ 17:21, 25 June 2022 (UTC)
- @Guarapiranga, I have. Sometimes ProveIt has been useful but most of the times manual editing is the only way I can solve the problems I'm talking about. To put it in very simple terms, what I'm really hoping to find is for a way to be able to just press something beside the error notification or as close to it as possible, be shown the error I need to fix, fix it and be done. The script gives me the error, I bring the solution, we move on to the next entry. Rinse and repeat. The less text hunting I need to do, the better. - Klein Muçi (talk) 17:59, 25 June 2022 (UTC)
- Yeah, that'd be useful, Klein Muçi. What sort of corrections you make? Do you always do them one by one, or are they repeated errors across the article that you can solve in bulk with a regex replace (or even across a set of articles with JWB)? — Guarapiranga ☎ 22:09, 25 June 2022 (UTC)
- @Guarapiranga, they're the one-by-one sort of edits. I have set up a pywikibot in my homewiki that utilizes A LOT of regexes (around 44k) to fix what can be fixed automatically periodically so after my bot does its job, I try to fix what's left. Currently, for example, I'm fixing some problems with dates. My bot is set up so it automatically translates every kind of English recognizable date format into its Albanian corresponding version so they don't end up as articles with errors in dates. This utilizes around 1k regexes but it only works for English dates. My bot doesn't understand other dates set up, for example, in Italian or in any other language. (That's because most of our articles are actually translations from here.) So in these cases I have to go and translate manually for each article. Another more common case would be the missing authors' names. You actually have to find the said authors and put their names in the citations and that can only be done manually. In all these cases the general idea is that you find an error beside a citation and you want to be able to fix it right there, not go hunting for the specific reference and parameter. If such an easy thing as I described did exist I could perhaps help in fixing citations even beyond my homewiki. - Klein Muçi (talk) 04:13, 26 June 2022 (UTC)
- Yeah, that'd be useful, Klein Muçi. What sort of corrections you make? Do you always do them one by one, or are they repeated errors across the article that you can solve in bulk with a regex replace (or even across a set of articles with JWB)? — Guarapiranga ☎ 22:09, 25 June 2022 (UTC)
- @Guarapiranga, I have. Sometimes ProveIt has been useful but most of the times manual editing is the only way I can solve the problems I'm talking about. To put it in very simple terms, what I'm really hoping to find is for a way to be able to just press something beside the error notification or as close to it as possible, be shown the error I need to fix, fix it and be done. The script gives me the error, I bring the solution, we move on to the next entry. Rinse and repeat. The less text hunting I need to do, the better. - Klein Muçi (talk) 17:59, 25 June 2022 (UTC)
Done Klein Muçi, that's a really neat idea! Bawl does this now. (just not the parameter part) Edit markers are added to each reference that open the editor (if it isn't open already) and select the reference in question.
There are some limitations: #tag:ref isn't detected, transcluded refs (like a template generating a ref) are not detected and if there are transcluded refs anywhere and the reference is unnamed and the reference has no URL and the reference has no 7+ digit number (like an ISBN) it may select the wrong reference or none at all. — Alexis Jazz (talk or ping me) 15:13, 14 August 2022 (UTC)- @Alexis Jazz: This is what urged me to give Bawl a try. After using it I understand the This is 'UGE! comment on its page. It does provide some highly sought after features like comment editing and completely redesigns the way we normally use Wikipedia in the main and talk space by simplifying it greatly. That said though, I'm personally reluctant to keep using it currently for reasons which are only tangentially related to it per se.
- First of all, there is room for improvement on details as you yourself say, for example in the ref part, interface small things like the + button on articles for sections not having its own separating lines or maybe the "forget the changes" button not being red colored, logic and behavior aspects like, what happens when you try to reply to 2 different discussions simultaneously, etc.
- Secondly, although I liked it a lot as a user, the script's simplicity ends up being a bit its downfall, paradoxically, seeing it from a wiki-mentor's POV. I run a lot of wiki-workshops in my country where I help new users getting started on Wikipedia. This usually involves me connecting my laptop with a monitor and basically showing other people how to do stuff in Wikipedia. The problem arises when you can do something very easily with Bawl and the new user can't really do that with its "basic account" and it basically can't really follow your explanation anymore. (Think about the "add a new section" part for an example.) As a wiki-mentor I'm forced to want for things to be, at least in the surface area, as close/identic to the native features as they can be. (And to keep being updated in regard to them continuously in order to be able to answer new users' questions. I mostly use source editing myself but I was forced to learn to deal with VE rigorously for this reason.) There are parts in Bawl which "stay under the surface", like the ref editing part, which won't normally be seen as often by new users. But there are also some parts which greatly change the most common used features in Wikipedia, like article editing or comment replying. In these cases, I'd prefer it if Bawl made use of the current native features instead of almost recreating new ones from scratch. Or at least tried to preserve the native features' interface and workflow as much as it could. For example, keeping the DiscussionTools overall interface intact (maybe the new icons can also stay) and only adding a new button for comment editing - the formatting, link adding and regex searching options are too much of a change unfortunately, at least in the way they currently are. Don't get me wrong, as a decade long user, I love the simplifications it provides (even the ones I just mentioned in the example above) but because of me having to deal a lot with new users I have to think of these details. I believe if you could think of ways to better integrate it organically with the native features while preserving it functions and the simplifications it provides (it's just a matter of interface changes mostly I think) we can not only expand its usage as a script but also use it as an example for the developing teams to update the current native features we have (think of the edit a comment feature) and ideally fully merge it with them in an upcoming future.
- This leaves me into the last part of my comment which is actually a request: Considering all I wrote above, could it be possible that you considered the option to release parts of Bawl's functionalities as lite script snippets on their own? For example the comment or ref editing functions. Bawl is a very, very powerful conglomerate tool that completely revolutionizes the current everyday wiki usage as I said but some of its features can also do good as standalone scripts I believe. In my case I'd really love it if I could use the ref script independently. Klein Muçi (talk) 11:27, 15 August 2022 (UTC)
- Klein Muçi, you have some interesting thoughts.
or example in the ref part
Support for #tag:ref could be added. A quick search shows more use than I expected, but most of it is evil. It's used to create references in references. No way I'm going down that rabbit hole.
Beyond that: unless the reference is named there is no solid link between the reference you see on an article page and its wikitext counterpart. I don't think this is fixable, short of having a bot forcefully name all unnamed references. That's why Bawl tries to find the reference using various methods. I just thought of one more method that will substantially increase the (already not bad) success rate, but 100% is just not possible.interface small things like the + button on articles for sections not having its own separating lines
Leftover from when I used to insert an icon there. FIxed.or maybe the "forget the changes" button not being red colored
It used to have primary+destructive flags but it's seriously distracting if you type blind. Even just the destructive flag without the primary is distracting. I'll make it red on hover, but permanently red is really annoying.logic and behavior aspects like, what happens when you try to reply to 2 different discussions simultaneously
By design, you can't.and the new user can't really do that with its "basic account"
I'm aiming for at least gadget status.which greatly change the most common used features in Wikipedia, like article editing
You can use Bawl as a general wiki editor (and I hardly use anything else anymore), but you don't have to.In these cases, I'd prefer it if Bawl made use of the current native features instead of almost recreating new ones from scratch
What do you mean "almost"?Bawl has no dependency on DiscussionTools. At all. Even the icons are own work! And it unifies the commenting/new section/article editing interfaces.
Or at least tried to preserve the native features' interface and workflow as much as it could.
DT sucks. That's why I made Bawl: to get it right. The 2010 wikitext editor is fine, but not having to leave the page is so much faster. The workflow is better. You're asking me to make it worse.and only adding a new button for comment editing
Not happening. Wikitext discussions are a mess. Bawl structures them, to a degree. Editing comments that were made with other tools isn't reliable as the needed structure may not always be there.but also use it as an example for the developing teams to update the current native features we have
The developing teams.. you mean the ones who send me vague accusations and stonewall me when asked to elaborate? Or those who leave many of my Phabricator tickets to rot for years? Okay, they're not all bad, but they are not listening either. Development on Bawl started in December 2021. 8 months. I've had help from testers, but I'm still the sole developer. 8 months. Providing this level of functionality would take the WMF developers a decade, and that's being optimistic. I've discovered several bugs in DiscussionTools along the way, most of which remain unfixed.and ideally fully merge it with them in an upcoming future
Replace. Ditch DT, install Bawl, problem solved. More responsive and a better experience on the client side, less demanding on the server side.could it be possible that you considered the option to release parts of Bawl's functionalities as lite script snippets on their own? For example the comment or ref editing functions.
For the most part: not really. First of all: absolute maintenance nightmare. Most features in Bawl depend on some functionality Bawl provides. Commenting for example requires timestamp detection, which is also used by the subscription feature. Hiding sections without new comments requires the subscription data and the collapsible sections functionality. Section reversal also relies on the collapsible section functionality. New comment notification depends on echo emulation. The reminder module (which is removable) also relies on echo emulation. The comment highlight-on-click I just added is also used when you follow a link to a new comment from the notification area. Reference editing requires a wiki editor that doesn't require leaving the page. I could make the reference editing into a module, but you'd still need Bawl.
At any rate you can disable everything you don't want or need. — Alexis Jazz (talk or ping me) 20:38, 15 August 2022 (UTC)- @Alexis Jazz, thank you for the thorough answer! I'll try to limit my reply to some main points so we can try to narrow the overall discussion.
- In regard to bugs and changes: Thank you for taking into consideration my suggestions! Those were only small things I noticed at first glance but if you're interested I can go on a lot more with specific suggestions on other details. For example, in regard to reply 2 different discussions simultaneously maybe we can have a warning/popup of some sort that explains what's going on (something like, you have already a discussion opened). Maybe it can only be activated if you already have some text in the first discussion; If you don't, it just jumps to the second one immediately. Also, again at quick glance, I did some reference fixing to test it out and I noticed I had to write the same edit summary over and over again after every edit. It would be nice if the box could remember it and show some suggestions like the current edit summary box does. This (the summary box), I assume, can be further fine-tuned to work differently for different reasons, for example for ref-fixing, instead of remembering old summaries, it can provide standard phrases automatically like "Fixed references using Bawl" and also mark every edit as a minor one, if so wished, similar to what AWB does. This is what I meant with behavior and logic. There is a lot of potential fine-tuning that can be done in a case by case basis according to the specific functions it provides but it's hard to track everything down in the same place because you kinda get overloaded mentally by all the possible interactions that Bawl provides simultaneously. That said though, as I mentioned above, I'd like suggesting more features and ideas if it's fine with you. (I'd do so in your talk page, not here.)
- In regard to integration with the native features: I can see your point when you say "You're asking me to make it worse.". And unfortunately the answer to that is that most likely, I may be. As I mentioned thoroughly above, gadgets that fork the basic native functionalities are a nightmare for mentors like me. Wikipedia is already TOO complex for every new user in the social media era. The native features are what new users get to experience and for that reason I've found myself many times doing the same discussion we just did now. I find VE limiting on some aspects but "I'm forced" to use that limited feature and try and talk about enhancing it instead of using the source code way because I understand that most new users use VE instead of the source code editor and, as with most native features, that will most likely be the future, just by the sheer force of numbers. For the same reasons, I was happy when some of the ConvenientDiscussions' features became the reply tool, a native feature, and I can bring even more examples on this aspect regarding Twinkle, etc. but I believe I already explained what I had in mind.
- I read about your relation with some of the members from the community and I understand your stance on the subject. I also understand how what I said above about native features and their usage could not correlate with your overall POV about the subject, especially in regard to Bawl-DT. That is totally fine. As I said, I really like it and I greatly appreciate your, apparently, less-than-a-year solo progress on it. I was just explaining my POV and the motives behind it.
- In regard to chopping down Bawl on smaller snippets: I understand. What I had in mind was a "template-like creation" where Bawl was rewritten to be more or less an invocation of multiple other scripts ("templates") which could very well stand on their own. But I've yet to read the code that makes Bawl possible and I have literally less two weeks that I've started studying JS myself coincidently so I'll just take your words on it. I guess I'll have to try and work with the on-off feature switches now.
- TL;DR: I can write again for new bugs and features if that's okay with you; I'm a fan of native features but I fully understand your liking for an independent gadget; I was hoping to have independent script snippets but if you say that we can't escape Bawl as a single unit, I'll try my luck with the feature switches. - Klein Muçi (talk) 00:43, 16 August 2022 (UTC)
- Klein Muçi, please share additional bug reports and feature requests on User talk:Alexis Jazz/Bawl!
I'll look at the points you mentioned, input like this is very valuable. There are many things I'd simply never think of. Getting inspiration from Bawl's talk page, this page, User:Enterprisey/reply-link/features, Phabricator tickets like phab:T157894 and random questions like mw:Topic:Wq9naisijuc49d6x has been a great help.
In regard to chopping down Bawl on smaller snippets: I understand. What I had in mind was a "template-like creation" where Bawl was rewritten to be more or less an invocation of multiple other scripts ("templates") which could very well stand on their own.
Bawl supports modules, but the idea behind modules is that they depend on Bawl somehow. Otherwise they could just as well be individual scripts. I wrote the reminder (Memoria) as a module because if phab:T306211 ever gets resolved it won't have to depend on Bawl's echo emulation anymore. So it could become an individual script in the future. — Alexis Jazz (talk or ping me) 09:55, 16 August 2022 (UTC)- @Alexis Jazz, okay then. I'll go on with the link you provided. There may be many micro-posts as I test out its features. You have been warned. :P - Klein Muçi (talk) 10:05, 16 August 2022 (UTC)
- Klein Muçi, please share additional bug reports and feature requests on User talk:Alexis Jazz/Bawl!
- @Alexis Jazz, thank you for the thorough answer! I'll try to limit my reply to some main points so we can try to narrow the overall discussion.
- Klein Muçi, you have some interesting thoughts.
MassUndo
As many editors would know, block and ban evasion is not always detected quickly, sometimes if it happens on relatively quiet topics, it can remain hidden for several months before being rooted out and dealt with. Then you are left with the task of clearing up stuff, such as G5'ing and reverting.
For example with Itsisaacs, the editor had forked a template multiple times, then proceeded to transclude those forks into several hundred pages. To allow those templates to be G5'd without leaving behind hundreds of broken transclusions required hours of one-by-one, opening the page history, reverting the transclusion (and anything else they had done, if possible), and moving on to the next page, before finally being able to G5 all the forked templates.
'MassRollback' is a thing, but that is only useful when their edits are the most recent revision, but in this case, a full 4 months had elapsed, and most of their edits weren't the most recent revision.
This is just one of several times that I have found myself frustrated at the lack of a tool to do this, all these times have been when I've been staring at the contributions list of a block or ban evader who managed to avoid detection for longer than most.
What this needs is a script that allows for the mass reversion of edits by a single user with the 'Undo' function, as opposed to 'Rollback'. It would start at their most recent edits, undoing whatever it could. It should also be able to be filtered, (via the inbuilt contributions list filtering) such as by namespace, to avoid reverting 'Talk' edits unnecessarily, or by date, so that only edits made after a block or ban are reverted. The interface would ideally be similar to the MassRollback script, allowing for either all edits to be reverted, or only a specified selection.
I've tried to write it myself, but I don't know the first thing about JavaScript coding. Mako001 (C) (T) 🇺🇦 04:32, 18 August 2022 (UTC)
- Mako001,
but I don't know the first thing about JavaScript coding
never stopped me..
Wikipedia:Kill-It-With-Fire
Probably suffers from the same issues as the code it's forked from. IIRC Cat-a-lot/Restore-a-lot always report success due to not actually reading the API response.. — Alexis Jazz (talk or ping me) 12:03, 19 August 2022 (UTC)- I could probably learn it a bit more... I'm still working on getting mastery of VisualBasic, learning how to pull off neat stuff with that. The next thing on the list would be SQL, then JavaScript . Unfortunately, VisualBasic macros can do stuff like run away and print 100 pages of database material with one button click. Mako001 (C) (T) 🇺🇦 12:25, 19 August 2022 (UTC)
- Mako001, VB, I can't remember that, that's 20+ years ago. SQL, also a long time ago. You don't need either to learn JS. Oh, and if you screw up a regular expression or loop JS can make your browser hang. (but any recent browser detects that state after a while and offers shut it down)
Anyway, let me know if Kill-It-With-Fire works for you. — Alexis Jazz (talk or ping me) 12:42, 19 August 2022 (UTC)- Most businesses use software designed back in those days (with fairly little in the way of major improvement), and rely on such languages as VB and SQL regularly (yay. everyone. loves. Microsoft.). Maybe Straya is just way behind.
- I like the name, much more original than MassUndo.
- Anyhow...
- I've run a bit of a test on the edits of a test account of mine. It seems to work fine when I selected a few edits to undo, but for some reason didnt activate when I used "all"?
- Also, how would I move the box that pops up into somewhere higher up? Mako001 (C) (T) 🇺🇦 12:54, 19 August 2022 (UTC)
- You can do what you like to Special:Contributions/Mako001-unconfirmed, thats where i was testing Mako001 (C) (T) 🇺🇦 13:03, 19 August 2022 (UTC)
- Hang on, it worked when I ran it on Itsisaacs remaining edits. Ill just use their username in a quasi-default summary with the actual reason at the end, should work, and I'll try test some more. Mako001 (C) (T) 🇺🇦 13:12, 19 August 2022 (UTC)
- Mako001, moving the box: it's draggable. You can also add
#killitwithfire{bottom:3em}
to Special:MyPage/common.css. (maybe needs !important flag) — Alexis Jazz (talk or ping me) 14:30, 19 August 2022 (UTC)- For some reason it doesn't seem to work properly the second time you use it for a given contribs list? It should still do though, at least for most occasions where I have been wishing I had it, but might need some tweaks still. Mako001 (C) (T) 🇺🇦 14:56, 19 August 2022 (UTC)
- Mako001, just fixed the "select all" issue, the "second time" issue was maybe related as I can't seem to reproduce it. — Alexis Jazz (talk or ping me) 15:11, 19 August 2022 (UTC)
- Likely, it behaved similarly in both cases so that is probably the case. Mako001 (C) (T) 🇺🇦 15:24, 19 August 2022 (UTC)
- Mako001, just fixed the "select all" issue, the "second time" issue was maybe related as I can't seem to reproduce it. — Alexis Jazz (talk or ping me) 15:11, 19 August 2022 (UTC)
- For some reason it doesn't seem to work properly the second time you use it for a given contribs list? It should still do though, at least for most occasions where I have been wishing I had it, but might need some tweaks still. Mako001 (C) (T) 🇺🇦 14:56, 19 August 2022 (UTC)
- You can do what you like to Special:Contributions/Mako001-unconfirmed, thats where i was testing Mako001 (C) (T) 🇺🇦 13:03, 19 August 2022 (UTC)
- Mako001, VB, I can't remember that, that's 20+ years ago. SQL, also a long time ago. You don't need either to learn JS. Oh, and if you screw up a regular expression or loop JS can make your browser hang. (but any recent browser detects that state after a while and offers shut it down)
- I could probably learn it a bit more... I'm still working on getting mastery of VisualBasic, learning how to pull off neat stuff with that. The next thing on the list would be SQL, then JavaScript . Unfortunately, VisualBasic macros can do stuff like run away and print 100 pages of database material with one button click. Mako001 (C) (T) 🇺🇦 12:25, 19 August 2022 (UTC)