User talk:Theleekycauldron/DYK promoter

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

bugs 'n' stuff go here!

Changelog[edit]

Project start: 2022 May 2

  1. 2022 May 4:
    1. Added buttons to close and mark nominations as withdrawn
    2. Added function to require users to select a hook and hook slot before submitting
    3. Disabled using the program on already-closed nominations
    4. Bold and italics in hooks now display in the promoter, instead of ''' and ''
    5. Stopped image file selector from breaking things
    6. The nompage is now edited before the prep set, to allow for reloading
    7. When the button to load the prep set is clicked, it is temporarily disabled to prevent double-clicking
    8. Added alert to discourage user from promoting a nomination they've edited
    9. Added functionality to automatically scrub anything between italicized parentheses[a] if the hook is promoted without an image
  2. 2022 May 5: fixed detection of the |status= parameter in checking for approval
  3. 2022 May 10: Fixed bug causing the program to delete everything in the prep set, starting from the bottom credit, whenever a hook was promoted to the quirky slot
  4. 2022 May 19: Fixed bug from the imported Regex causing the program to read to the farthest possible question mark for the hook (often including parts of the source)
  5. 2022 June 15: Fixed bug causing a crash if the image file has no |caption= parameter

Notes

  1. ^ such as (pictured)

I am aware of these bugs![edit]

Sorry I haven't gotten around to fixing them yet; but rest assured, I am "monitoring the situation very carefully"...

  • The script kinda nukes the bottom half of the prep set when a hook is promoted the quirky slot fixed; I misplaced a singular parenthesis.
  • The regex that detects hooks on the nompage is a little broken (thanks, Wugapodes!) theleekycauldron (talkcontribs) (she/they) 05:43, 10 May 2022 (UTC)[reply]

Error[edit]

theleekycauldron I received the error Uncaught (in promise) TypeError: imgfiles is not iterable at HTMLInputElement.load (index.php?title=user:theleekycauldron/DYK_promoter.js&action=raw&ctype=text/javascript:232:17) when trying to promote Template:Did you know nominations/Dancing with Dandelions (sculpture) to prep 6. SL93 (talk) 22:58, 10 May 2022 (UTC)[reply]

hmmph, that'd be because of the multiple detected image files. I'll figure it out sometime today, ping you when it's fixed. theleekycauldron (talkcontribs) (she/they) 23:02, 10 May 2022 (UTC)[reply]
theleekycauldron My web page freezes on Edge and Chrome when I click submit using the tool at Template:Did you know nominations/Takogo kak Putin. SL93 (talk) 11:27, 30 May 2022 (UTC)[reply]
I promoted it manually and a javascript error message was never shown. I was able to promote a different nomination just fine using the tool. SL93 (talk) 19:09, 30 May 2022 (UTC)[reply]
sorry, SL93, I can't reproduce the error- sometimes the webpage freezes for random noms, and I reload and it's fine. theleekycauldron (talkcontribs) (she/they) 09:21, 3 June 2022 (UTC)[reply]

that button[edit]

It says: clicking the large, blue button to the right, labelled "install" There is no button for me. Schwede66 01:40, 10 June 2022 (UTC)[reply]

@Schwede66: This method requires a gadget: under "Advanced", check "Install scripts without having to manually edit JavaScript files". theleekycauldron (talkcontribs) (she/they) 01:44, 10 June 2022 (UTC)[reply]
I somehow skipped that line. Hand me that trout! Schwede66 01:47, 10 June 2022 (UTC)[reply]

Approved API[edit]

Regarding Special:Diff/1121753497, I could expose an API where you give it a nomination template and it tells you if it's approved or not. I'm thinking something like https://dyk-tools.toolforge.org/api/status/?template_name=Template%3ADid+you+know+nominations%2FDavlos and it gives you a little json blob:

{
 'page': 'Template%3ADid+you+know+nominations%2FDavlos',
 'is_approved': true,
}

If the goal is to verify that a hook is approved before promoting it, this makes more sense than looking at Category:Approved hook or whatever because it would always be up to the moment. If you would use that, let me know and I'll code it up. The hard part is already done; wrapping an API route around it would be trivial. -- RoySmith (talk) 22:45, 25 December 2022 (UTC)[reply]

Issue[edit]

I received these errors when trying to promote Template:Did you know nominations/Mimi Kilgore to the quirky slot of prep 6. SL93 (talk) 14:30, 7 January 2023 (UTC)[reply]

mw.loader.implement.css @ load.php?lang=en&modules=jquery%7Cjquery.ui&skin=monobook&version=8mvm5:145 /w/index.php?title=User:Fox_Wilson/delsort-monobook.js&action=raw&ctype=text/javascript:1

Failed to load resource: the server responded with a status of 403 () Mimi_Kilgore#:1

Refused to execute script from 'https://en.wikipedia.org/w/index.php?title=User:Fox_Wilson/delsort-monobook.js&action=raw&ctype=text/javascript' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. SL93 (talk) 14:30, 7 January 2023 (UTC)[reply]

theleekycauldron SL93 (talk) 14:31, 7 January 2023 (UTC)[reply]
It looks like I figured it out. A credit was missing from the prep. SL93 (talk) 22:23, 7 January 2023 (UTC)[reply]
@SL93: Yeah, that tends to be the issue a lot these days :) I wonder if there's something I could do about that... theleekycauldron (talkcontribs) (she/her) 01:16, 8 January 2023 (UTC)[reply]

What am I doing wrong?[edit]

I'm not a regular user of this tool; today, attempting to replace a pulled hook in Queue 1, I decided to give it a try. I selected Queue, 1, checked the slot, checked the desired hook; and the tab froze on me. I can quite believe there's something wrong with my settings, or my order of operations, but I'm wondering what it might be. Vanamonde (Talk) 01:20, 8 January 2023 (UTC)[reply]

@Vanamonde93: would you mind linking me to the nomination page? theleekycauldron (talkcontribs) (she/her) 01:25, 8 January 2023 (UTC)[reply]
@Vanamonde93: Ah, I see. So, when you pull a hook from prep or queue, you need to replace the credit with a blank credit slot. Those look like this:
* {{DYKmake|Example|Editor|subpage=}}
If you're pulling the bottom hook, you also need to add this:
* {{DYKnom|Example|Nominator}}
PSHAW looks for those blanks when adding credits, it doesn't know what to do otherwise – hope this helps! theleekycauldron (talkcontribs) (she/her) 01:28, 8 January 2023 (UTC)[reply]

I tried using it and all I got was a message that PSHAW is under development. Am I doing something wrong? Hawkeye7 (discuss) 21:41, 25 January 2023 (UTC)[reply]

@Hawkeye7: Sorry I missed this! Instead of clicking on PSHAW from a prep, navigate to PSHAW from the nomination you want to promote – that'll show you the correct screen. theleekycauldron (talkcontribs) (she/her) 20:39, 28 January 2023 (UTC)[reply]

Page refresh[edit]

Have installed. Will probably never use! Looks well handy though. Just a thing, whichever method of installing one chooses, the page must be refreshed—I think?—so that note about FF/Chrome/Safari could be useful here? Thanks again for this! ——Serial Number 54129 14:03, 20 March 2024 (UTC)[reply]