User:N8wilson/EggHunt

Help locate links that might be WP:EASTEREGGs.

Adds a new tool to article pages that (when clicked) tags certain wikilinks in prose with emojis to indicate possibility of being an "Easter Egg" link.

From least probability to highest, the emojis used are: 🥚 &rarr; 🐣 &rarr;  🐥 &rarr; 🐤

The script is pretty limited as it only uses some character analysis to determine when a target article and the linked text do not align. Because of this, many of the tagged links will probably be okay. The point is just to draw attention to some that might need review.

Happy hunting.

How to use it
Once installed, you can find a new link in the "Actions" section of the "Tools" menu when browsing article pages only. The link will provide a count of how many possible eggs the script found. For example, it might say "35 possible 🥚s". Click this new menu item and the script will tag each of the links it found with one of the emoji above. The more "hatched" the egg is, the more "distance" between the link text and the target article of the link.

 3) to the shortest of text/target as a percentage. Result: titles with "more similarity" across text score higher.
 * test comparison using unordered substrings which allows for reversed modifiers ("Midway battle" vs "Battle of Midway")
 * allow comparison of display text with either the article title OR the target anchor if one is provided. See "practice areas" link at Risk (This is already handled in cases where the link text is wholly contained in the target anchor but not the reverse.)
 * consider boosting scores of articles that begin with common patterns ("List of...", "Comparison of...", etc.) in the same way as was done for disambiguation terms tacked on to the end.
 * Un-marking (toggle switch) with state saved in user context; just use classes that get added and removed
 * Redirect checking - if a piped link targets a redirect and that redirect loops back to the piped text, just use the piped text instead as per MOS:PIPE
 * configurable styling
 * exclude IPA links (pronunciation)
 * exclude very short links such as symbols (i.e. $), It's very likely that two- and possibly three-letter acronyms might also make sense.
 * handle common abbreviations? (United States &rarr; US, USA, U.S.)
 * detect links where the displayed text is a valid article and the that article redirects to the pipe target.

Issues

 * Coordinates (top right) get tagged as EGG on pages that used Coordinates
 * Menu doesn't close after running code?
 * World War II with the non-breaking space doesn't seem to match with "World War II" and I'm not sure why. It might not even be related to the space coding.
 * quotations aren't really a technical issue but the ability to fix will be limited by the fact that the phrasing can only be adjusted in limited ways.

Legend
-->