Jump to content

User:N8wilson/AQFetcher

From Wikipedia, the free encyclopedia
Example of AQFetcher stylizing a portion of the Wikipedia home page on Oct. 31, 2015

Article Quality (AQ) Fetcher will stylize as many links as possible according to the quality of their target article by assigning CSS classes accordingly. The following CSS classes are assigned once the script has completed:

    AQ-FA    AQ-A    AQ-Start          AQ-Unclassified
    AQ-GA    AQ-B    AQ-Stub           AQ-Unknown
             AQ-C

These correspond to the standard grades defined by the Editorial Team with the exclusion of the two quality grades for lists (FL or Featured List, and L or List).

AQ-Unclassified and AQ-Unknown are the only additions. The script is a work in progress and for the most part these two categories can be treated as the same. In the future, AQ-Unclassified should indicated that the target article has not yet been evaluated for quality. AQ-Unknown on the other hand should always indicate that this script could not determine whether the target article was assessed or not. At the time of publishing this script however (Oct 2015), I'm having difficulty properly assigning the AQ-Unknown CSS class.

Usage and Installation

[edit]

To install this script, copy/paste the code snippet below into your common.js file.

importScript('User:N8wilson/AQFetcher.js'); // Linkback: [[User:N8wilson/AQFetcher.js]]

IMPORTANT NOTE: You also need to provide the style/color for each type of link. If you do not plan to write your own CSS, you will need to add an additional line to common.js to complete the installation. Please see the section on styles and colors below for a couple of options. If none of this makes sense to you, just add the following line as well (immediately under the line above is fine):

importStylesheet('User:N8wilson/AQFetcher.css'); // Linkback: [[User:N8wilson/AQFetcher.css]]

Styles and Colors

[edit]

If the script is used in isolation there will be no color changes on Wikipedia. The only changes the script makes are to add class attributes to link elements in article pages. Feel free to use your own styles following one the CSS models below or import them directly. Simply import the preferred stylesheet in your common.js file or the appropriate theme-specific stylesheet.

General Purpose

[edit]
  • User:N8wilson/AQFetcher.css - color-coded links according to the quality scale.
  • User:N8wilson/AQFetcher-Icons.css - show icons before links instead of re-coloring them. This style helps make AQFetcher more compatible with similar scripts that would also color links. Thanks to Pythoncoder for providing this style.

For Readers

[edit]

For Editors

[edit]

I've found these styles particularly useful for browsing the under-developed corners of Wikipedia:

Acknowledgements

[edit]

Key acknowledgement goes to Anomie whose link classifier script (User:Anomie/linkclassifier.js) was used as an initial template structure to get up an running quickly with the MW API. Go check it out if you're interested in a lot more ways to classify and color various links on MediaWiki sites.

Pythoncoder provided a really helpful alternative icon style. It's great if you use lots of various scripts together. Thanks!

Known Limitations

[edit]
  • Article Namespace - By design the script only runs when browsing in the article namespace. It will not stylize links on pages in User:, Talk:, Wikipedia:, Category:, or any other namespaces. I wrote this way because I'm already uncomfortable with the number of API XHR requests the script makes on large pages. --N8 21:01, 31 October 2015 (UTC)
  • Multiple classification - If an article has multiple classifications (by different WP projects for example) the classification to which this script gives preference is undefined.
  • Unclassified/Unknown - I can't seem to properly mark article links with the 'AQ-Unknown' class at this time.
  • Redirects - Links which have not been updated and point to a redirect page will not be stylized according to the redirection target.
  • Speed ...it's not super fast. I can usually see the styles applied in phases after the article page loads.

Quality Scale Reference

[edit]

See also

[edit]