DYKcheck is a JavaScript tool for checking Did You Know eligibility.

Screenshot of DYKcheck

What DYKcheck is

The DYKcheck tool was made to help editors review nominations for Did You Know (DYK) that appear on Template talk:Did you know (T:TDYK). Nominators have complained that they get notified of problems too late and don't get a chance to fix the nomination. With DYKcheck, reviewers can very quickly spot some common errors and check nominations early in the process. The tool scans nominations against a slew of rules and shows the results. It's up to the reviewer to act on the results. DYKcheck scans for:

In addition, DYKcheck has a rapid-fire nomination checker on T:TDYK. It has the capability to check nominations with multiple articles and multiple hooks. On top of checking everything above for each nominated article, DYKcheck also finds hooks, both the original and alternates, and calculates the hook length.

What DYKcheck is not

DYKcheck is not:

Using DYKcheck

If you're a user on Wikipedia, you can easily install DYKcheck by adding the line below to your common.js file. After installation you may need to bypass your browser cache on pages you've visited before for the tool to appear in the toolbox. If installation worked, "DYK check" should appear in the Toolbox, below "Cite this page". Simply click on the "DYK check" link in the Toolbox to start a scan. If you're not using Firefox or you've got a fancy personalized layout, you may want to turn off fixing the sidebar using the fixedSidebar variable (see below for details), as it can cause T:TDYK to look strange.

importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool

Features

Prose length

DYKcheck calculates the prose of the article. This part is a slightly modified version of the prosesize tool. It does not count tables, block quotes, headers, images, captions, templates, infoboxes, edit buttons, categories, references, lists, superscripts, or reference link numbers like [1]. The text is highlighted so the user can see what's being counted as prose. (In older versions of Internet Explorer, headers may be highlighted even though they aren't counted as prose.)

Article creation

DYKcheck finds who created the article and the date it was created. The only limit is if Wikipedia's servers have the information. For example, information on the creation of the Main Page is not available. In that case, DYKcheck will return the first edit recorded in Wikipedia's servers. The tool will also see if the article was created as a redirect. If so, the next three revisions of the article will be checked to see when it was made into a real article. After the userspace move and expansion check are also calculated, DYKcheck finds the latest of the three dates and compares it to today's date. The tool shows if the latest date is not within the past 10 days. Number of days is rounded down in favor of nominators.

Moves from userspace

DYKcheck scans the last 100 edits for a move from userspace. The script will find the last move from userspace if the article has been moved multiple times.

Stub tags

The tool looks for stub tags on both the article page and its talk page.

DYK and ITN

DYKcheck looks at the talk page of the article for the ((dyktalk)) and ((ITNtalk)) templates.

Inline citations

DYKcheck searches for inline citations (with <ref> tags) and notes if there aren't any.

Dispute and deletion tags

DYKcheck scans the article for various tags. If the article is at Articles for Deletion, the script gives a link to the deletion discussion. Other tags are found by their images (full list is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13). Speedy deletion tags are also detected.

Expansion

DYKcheck finds the start of expansion date, assuming the article is now 5x expanded. It checks the last 500 edits with a binary search algorithm. Because of this, DYKcheck assumes that the article has more or less been always increasing in size. Minor fluctuations won't matter, but if the article crosses the 1x line multiple times, the tool can get confused. If it does get confused, it will err against the nominator; it will never show a more recent date for 1x than the actual. Therefore, reviewers should always check expansion manually if DYKcheck says the article hasn't been expanded 5x. This part of the scan takes the longest because up to nine requests from the server are made sequentially.

Rapid-fire mode on T:TDYK

This section is currently not relevant. It describes DYKcheck behavior from the time before nomination templates, when the text of all nominations was on a single page.

DYKcheck can scan individual nominations from the nominations page (T:TDYK). For each nomination it can process multiple articles and multiple hooks. Hook length is calculated without the leading "... ", but including "that" and "?". If "(pictured)" is included in the hook, it isn't counted, but any phrases along with it are (for example, (cat pictured) would add four characters to the hook length). The phrase "(pictured)", including the parentheses, must have the same formatting throughout (in other words, completely italicized) for DYKcheck to pick up on it. The hooks are detected by "... that " at the start and "?" at the end. The tool will not get thrown off by stray question marks in the nomination comments, but it will get thrown off by stray "... that "s, and stray question marks inside the hooks. Since DYKcheck finds the end of the hook by the question mark, it does not process multiple sentence hooks.
Since all of the nominations have the article titles as subsubheadings, DYKcheck searches for subsubheadings to get the individual nominations. If there are any subsubheadings that don't correspond to nominations, the tool will get confused. Getting the tool to do multiple article noms was actually trickier than I thought it would be. I could get it to find the article titles just fine. But when I iterated through them, the tool went haywire. It turns out that each article was being processed concurrently, resulting in nothing getting done. This didn't (and doesn't) matter for one article, because even though multiple pieces (for example, checking the talk page and checking for userspace moves) are being processed at the same time, they don't conflict with each other. With multiple articles though, each is trying to use the same methods. My solution was to have the articles be processed in order. A function checks when one article is finished and lets the next one go.
By default, DYKcheck only checks for expansion if the string "5x expan" shows up in the nomination. This saves resources, because the expansion check is by far the most costly. This is a configurable option (see below), so you can have it always check for expansion if you wish.
DYKcheck can also jump to nominations in sections of T:TDYK. If your URL shows a hash, DYKcheck will go to the section specified. For example, if the URL says http://en.wikipedia.org/wiki/T:TDYK#Older_nominations, the tool will start processing nominations from Older nominations. This makes it easier to jump around on a page with more than 200 noms. It also means that if you make an edit to a nomination, DYKcheck will pick up at that nom.
Since T:TDYK is such a long page, it would be tedious to keep scrolling up and down to hit the "DYKcheck" button in the toolbox. DYKcheck's solution is to fix the sidebar in place if you're on T:TDYK. This is another configurable option (see below), so if you hate it, or love it and want to use it all the time, it's easy to change the settings. It looks best if you have a big screen. Thanks to Omegatron and the meta user styles page for the sidebar code.

Options

There are five options to configure DYKcheck.

  • Variable dateFormat, parameters "british" and "american"; default "american"
  • Variables hookLengthYellow, hookLengthRed; default 200 and 220 respectively
  • Variable fixedSidebar, parameters "always", "onttdyk", "never"; default "onttdyk"
  • Variable check5xNoms, parameters "always", "ifnom5x", "never"; default "ifnom5x"
  • Variable unlock, parameters true and false

To use an option, enter variable = parameter; below the importScript line in your skin.js. The quotes, or lack of them, is important! For example, if I wanted the hook length yellow warning to appear at 215 characters, the red warning at 230 characters, and the sidebar to never be fixed, I would enter the lines below into my skin.js:

importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool
hookLengthYellow = 215;
hookLengthRed = 230;
fixedSidebar = "never";

Code

You can see the code for DYKcheck at User:Shubinator/DYKcheck.js.

Ideas for development

These are ideas I might incorporate into the tool at some point. Feel free to add requests.

Compatibility

DYKcheck works best with Mozilla Firefox. The script also works with Internet Explorer, Safari, Google Chrome, Opera, and Konqueror.
DYKcheck works on Wikimedia's secure server.