Jump to content

Wikipedia:Bots/Requests for approval/DYKToolsAdminBot

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RoySmith (talk | contribs) at 15:34, 1 March 2023 (Creating a BRFA subpage for DYKToolsAdminBot (easy-brfa)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Operator: RoySmith (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)

Time filed: 15:34, Wednesday, March 1, 2023 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): Python

Source code available: https://github.com/roysmith/dyk-tools/tree/main/dyk_tools/bot

Function overview: Applies move protection to DYK articles which are on the main page or in the queue to be placed on the main page soon.

Links to relevant discussions (where appropriate): Wikipedia talk:Did you know/Archive 188#Move protection

Edit period(s): Continuous

Estimated number of pages affected: 10 per day

Exclusion compliant (Yes/No): No

Already has a bot flag (Yes/No): No

Function details: Definitions

Nomination: A nomination template, i.e. a subpage of Template:Did you know nominations.

Hook: A string starting with "..." and ending with "?". Optionally includes a tag such as "ALT1".

Target: An article referenced from a hook using a bolded wikilink. All hooks have one or more targets.

Hookset: A template containing a collection of hooks along with other metadata. One of

Sylvilagus nuttallii
Sylvilagus nuttallii
(i.e. the current hookset), the 7 numerically named subpages of 
DYK queue status

There are currently 4 filled queues. Please consider promoting a prep to queue if you have the time!

DYK is running 12-hour sets.

Did you know?
Introduction and rules
IntroductionWP:DYK
General discussionWT:DYK
GuidelinesWP:DYKCRIT
Reviewer instructionsWP:DYKRI
Nominations
Nominate an articleWP:DYKCNN
Awaiting approvalWP:DYKN
ApprovedWP:DYKNA
April 1 hooksWP:DYKAPRIL
Holding areaWP:SOHA
Preparation
Preps and queuesTM:DYK/Q
Prepper instructionsWP:DYKPBI
Admin instructionsWP:DYKAI
Main Page errorsWP:ERRORS
History
StatisticsWP:DYKSTATS
Archived setsWP:DYKA
Just for fun
Monthly wrapsWP:DYKW
AwardsWP:DYKAWARDS
UserboxesWP:DYKUBX
Hall of FameWP:DYK/HoF
List of users ...
... by nominationsWP:DYKNC
... by promotionsWP:DYKPC
Administrative
Scripts and botsWP:DYKSB
On the Main Page
Main Page errorsWP:ERRORS
To ping the DYK admins{{DYK admins}}

When modifying a hook in a queue or prep area (other than minor formatting fixes), please notify the nominator by including a link of the form [[User:JoeEditor]] in your edit summary. (Ping templates like {{u|JoeEditor}} don't work in edit summaries.)

Administrators: Please ensure that there is always at least one queue filled at all times, to prevent overdue updates to the Main Page.

This page gives an overview of all DYK hooks currently scheduled for promotion to the Main Page. By showing the content of all queues and prep areas in one place, the overview helps administrators see how full the queues are, and also makes it easier for users to check that their hook has been promoted or to find hooks for copy-editing. Hooks removed from queues or prep areas for unresolved issues should have their nominations reopened and retranscluded at the nomination page.

You may need to purge this page to get it to display the latest edits.

The next update will be produced from Queue 4. After performing a manual update, please update the pointer to the next queue.

Current number of hooks on the nominations page

Note: See WP:DYKROTATE for when we change between one and two sets per day.

Count of DYK Hooks
Section # of Hooks # Verified
April 18 1
April 29 1
May 2 2
May 5 1 1
May 7 1
May 9 1
May 12 2
May 13 1
May 17 1
May 20 2
May 21 2
May 22 2
May 25 2 1
May 27 2
May 28 3 1
May 30 5 1
May 31 1
June 2 2 2
June 3 1 1
June 4 1 1
June 5 2 1
June 6 4 1
June 7 5 2
June 8 4 3
June 9 4 3
June 10 4 2
June 11 6 2
June 12 3 1
June 13 9 5
June 14 4 4
June 15 5 4
June 16 8 3
June 17 8 6
June 18 9 3
June 19 5 1
June 20 8 3
June 21 10 6
June 22 13 5
June 23 11 4
June 24 14 6
June 25 11 1
June 26 11 6
June 27 11 5
June 28 9 5
June 29 7 5
June 30 12 4
July 1 7 2
July 2 7 1
July 3
Total 245 102
Last updated 02:51, 3 July 2025 UTC
Current time is 04:34, 3 July 2025 UTC [refresh]

DYK time

Local update times

Los Angeles New York UTC London New Delhi Tokyo Sydney
Queue 4 3 July
05:00
3 July
08:00
3 July
12:00
3 July
13:00
3 July
17:30
3 July
21:00
3 July
22:00
Queue 5 3 July
17:00
3 July
20:00
4 July
00:00
4 July
01:00
4 July
05:30
4 July
09:00
4 July
10:00
Queue 6 4 July
05:00
4 July
08:00
4 July
12:00
4 July
13:00
4 July
17:30
4 July
21:00
4 July
22:00
Queue 7 4 July
17:00
4 July
20:00
5 July
00:00
5 July
01:00
5 July
05:30
5 July
09:00
5 July
10:00
Queue 1
Prep 1
5 July
05:00
5 July
08:00
5 July
12:00
5 July
13:00
5 July
17:30
5 July
21:00
5 July
22:00
Queue 2
Prep 2
5 July
17:00
5 July
20:00
6 July
00:00
6 July
01:00
6 July
05:30
6 July
09:00
6 July
10:00
Queue 3
Prep 3
6 July
05:00
6 July
08:00
6 July
12:00
6 July
13:00
6 July
17:30
6 July
21:00
6 July
22:00
Prep 4 6 July
17:00
6 July
20:00
7 July
00:00
7 July
01:00
7 July
05:30
7 July
09:00
7 July
10:00
Prep 5 7 July
05:00
7 July
08:00
7 July
12:00
7 July
13:00
7 July
17:30
7 July
21:00
7 July
22:00
Prep 6 7 July
17:00
7 July
20:00
8 July
00:00
8 July
01:00
8 July
05:30
8 July
09:00
8 July
10:00
Prep 7 8 July
05:00
8 July
08:00
8 July
12:00
8 July
13:00
8 July
17:30
8 July
21:00
8 July
22:00

Queues

Douglas at the 2016 Olympic Games
Douglas at the 2016 Olympic Games


The Washington D.C. Temple
The Washington D.C. Temple
Mandan Bull Dancer
Mandan Bull Dancer
  • ... that the end of the Okipa involved Bull Dancers of the Mandan tribe (example pictured) having ritual sex with married women and then smoking a "pipe of reconciliation" with their husbands?
  • ... that Taylor Swift wrote and dedicated a song to Ethel Kennedy?
  • ... that some people chanted "USA, USA!" and others waved Peruvian flags at the inauguration of Pope Leo XIV?
  • ... that Mabel MacFerran Rockwell was the only female engineer to work on designing the electrical systems for Hoover Dam?
  • ... that the 2018–19 College Football Playoff included a game between Alabama and Clemson, making it the fourth consecutive playoff to include such a game?
  • ... that William R. Ferguson received a two-year prison sentence for selling a medical device that was claimed to cure disease through "a force unknown to science"?
  • ... that the name of the song "Shagidi" was inspired by a children's game?
  • ... that ...
  • ... that a Twitter user and an animal sanctuary were involved in a copyright dispute over Meatball?


Fossil Bohlenia americana leaflets
Fossil Bohlenia americana leaflets


Instructions on how to promote a hook

At-a-glance instructions on how to promote an approved hook to a prep area
Check list for nomination review completeness
  1. Select a hook from the approved nominations page that has one of these ticks at the bottom post: .
  2. Check to make sure basic review requirements were completed.
    • Any outstanding issue following needs to be addressed before promoting.
  3. Check the article history for any substantive changes since it was nominated or reviewed.
  4. Images for the lead slot must be freely licensed. Fair-use images are not permitted. Images loaded on Commons that appear on the Main Page are automatically protected by KrinkleBot.
  5. Hook must be stated in both the article and source (which must be cited at the end of the article sentence where stated).
  6. Hook should make sense grammatically.
  7. Try to vary subject matters within each prep area.
  8. Try to select a funny, quirky or otherwise upbeat hook for the last or bottom hook in the set.
Steps to add a hook to prep
  • In one tab, open the nomination page of the hook you want to promote.
  • In a second tab, open the prep set you intend to add the hook to.

Wanna skip all this fuss? Install WP:PSHAW instead! Does most of the heavy lifting for ya :)

  1. For hooks held for specific dates, refer to "Local update times" section on DYK Queue.
    • Completed Prep area number sets will be promoted by an administrator to corresponding Queue number.
  2. Copy and paste the hook into a chosen slot.
    • Make sure there's a space between ... and that, and a ? at the end.
    • Check that there's a bold link to the article.
  3. If it's the lead (first) hook, paste the image where indicated at the top of the template.
  4. Copy and paste ALL the credit information (the {{DYKmake}} and {{DYKnom}} templates) at the bottom
  5. Check your work in the prep's Preview mode.
    • At the bottom under "Credits", to the right of each article should have the link "View nom subpage" ; if not, a subpage parameter will need to be added to the DYKmake.
  6. Save the Prep page.
Closing the DYK nomination page
  1. At the upper left
    • Change {{DYKsubpage to {{subst:DYKsubpage
    • Change |passed= to |passed=yes
  2. At the bottom
    • Just above the line containing

      }}<!--Please do not write below this line or remove this line. Place comments above this line.-->

      insert a new, separate line containing one of the following:
      To [[TM:DYK/P1|Prep 1]]
      To [[TM:DYK/P2|Prep 2]]
      To [[TM:DYK/P3|Prep 3]]
      To [[TM:DYK/P4|Prep 4]]
      To [[TM:DYK/P5|Prep 5]]
      To [[TM:DYK/P6|Prep 6]]
      To [[TM:DYK/P7|Prep 7]]
    • Also paste the same thing into the edit summary.
  3. Check in Preview mode. Make sure everything is against a pale blue background (nothing outside) and there are no stray characters, like }}, at the top or bottom.
  4. Save.

For more information, please see T:TDYK#How to promote an accepted hook.

Handy copy sources:

  • To [[TM:DYK/P1|Prep 1]]
  • To [[TM:DYK/P2|Prep 2]]
  • To [[TM:DYK/P3|Prep 3]]
  • To [[TM:DYK/P4|Prep 4]]
  • To [[TM:DYK/P5|Prep 5]]
  • To [[TM:DYK/P6|Prep 6]]
  • To [[TM:DYK/P7|Prep 7]]

Prep areas

Note: The next prep set to move into the queue is Prep 1 [update count].

Belimpasaki, Święty-Ersetic and De Witte
Belimpasaki, Święty-Ersetic and De Witte
Kate Nash
Kate Nash
Administration Building
Administration Building
1672 portrait of Ivan Kalita
1672 portrait of Ivan Kalita
  • ... that Ivan I of Moscow (pictured) earned the nickname "Kalita", which literally means "money bag"?
  • ... that Morocco's abortion law requires spousal consent, but it does not explicitly require the consent of the woman receiving the procedure?
  • ... that after losing his left arm in a dogfight where he downed a Japanese plane, Chinese pilot Shi Bangfan was honored with brand cigarettes named after him?
  • ... that El Salvador's only goal at the FIFA World Cup occurred during a 10–1 loss to Hungary?
  • ... that Nurtami Soedarsono helped to identify victims of the 2012 Sukhoi crash?
  • ... that according to The Big Con, big consultancies are playing both sides—advising the fossil fuel industry while shaping government climate policy?
  • ... that sprinter Kenaz Kaniwete was the youngest athletics competitor at the 2024 Summer Olympics?
  • ... that a socialist youth organization held an anti-NATO music festival attended by 20,000 people in 1982 West Berlin?
  • ... that despite calls to remember housing activist Michael Brown in 1988, a 2024 academic article could not find any subsequent trace of him?
Red Fićo monument
Red Fićo monument
  • ... that a monument in Croatia (pictured) depicts a small red car triumphing over a battle tank?
  • ... that during Oduwa's reign, cowries became so widespread as currency that nobles stitched them into their clothes—causing runaway inflation?
  • ... that since the first work of Korean science fiction appeared in 1929, the field has evolved into distinct North and South branches?
  • ... that Sue Anderson helped to break through the glass ceiling for female conductors on Broadway?
  • ... that the flowers falling off of the final dress in Alexander McQueen's Sarabande was a serendipitous effect?
  • ... that Malawian bishop Fanuel Magangani was circumcised as an adult to promote its effectiveness in reducing HIV transmission?
  • ... that the actress Emma Stone contributed "oddities" to Florida!!!?
  • ... that governor of North Sulawesi, Indonesia, Yulius Selvanus used his parents' clan names for "personal branding"?
  • ... that the Mansfield Town Mill has produced flour, textiles and cannabis?
M. dryades in its natural habitat
M. dryades in its natural habitat
Caption goes here
Caption goes here
  • ... that ... (pictured) ...
  • ... that ...
  • ... that ...
  • ... that ...
  • ... that ...
  • ... that ...
  • ... that ...
  • ... that ...
  • ... that ...

, or the 7 numerically named Template:Did you know/Preparation area 1, etc.

DYKToolsBot is already approved for a different task, but does not have admin rights. This new account (DYKToolsAdminBot) will handle tasks that require admin rights. They share the same code.

There are two distinct tasks proposed here, protect and unprotect. Both tasks are run as scheduled toolforge jobs. Currently both tasks run every 10 minutes, offset by a few minutes. The exact timing is not critical.

The protect task does:

Parse the main page + queue hooksets, extracting all the hooks. From the hooks, extract the targets which need protecting ("protectable targets"). These titles are indicated by wikilinks set in bold. There is typically one target per hook, but there can be more than one. For each protectable target, indef move=sysop indef protection will be applied. The page protection log messages will include a link to a page in the bot's userspace explaining the process.

The unprotect task does:

Queries the bot's user log with type=protect for the previous N days, where N is long enough to account for any hooks which have progressed through the normal promotion process plus extra time to account for intra-queue hook swapping. It's currently set to 9, but might need to be increased. The exact value is not critical. These are the "unprotectable targets". The current list of protectable targets is acquired as in the protect task. Any targets in the unprotectable set which are not also in the protectable set are unprotected.

I considered computing an expiration date and only protecting until then. The problem is that the expiration date is a moving target. Hooks often get shuffled around when problems are discovered. Sometimes hooks get unpromoted entirely after hitting a queue (or even when they're on the main page). Sometimes the queue processing schedule is disrupted by failure of the bot which manages that process (this has happened a couple of times in the past few weeks). A few times a year, queue processing toggles between 1 per day or 2 per day. Keeping track of all these possibilities and updating the expiration time would add significant complexity for no benefit. It's far simpler to use a declarative approach, in the style of puppet; periodically figure what state each target should be in right now and make it so, regardless of history.

Known problems

On rare occasions, hook targets are written as templates such as one of the (many) Error: {{Ship}} missing name (help) variants. The current code does not recognize these properly This happens infrequently enough, and it's difficult enough to do correctly (it requries a call out to Parsoid), and the consequence is mild enough (a page doesn't get the move protection it should), that I'm not going to make it a blocker for an initial deployment.

If a target was already move protected before entering the DYK pipeline, it will have that protection removed when it transitions out of DYK. The probability of this happening is so low, I'm going to ignore it. The alternative would be to maintain a database of pre-existing protections so they could be restored properly, which seems like more trouble than it's worth.

If enough protection log history isn't examined, it's possible to miss unprotecting a target which spent an abnormally long time in the DYK queues. If it happens, the target can be manually unprotected and the history window size increased.

Discussion