Jump to content

User:1250metersdeep/wikistats.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// WikiStats by 1250metersdeep

// Retrieve the current page name from MediaWiki configuration
var pagename = mw.config.get('wgPageName');

// Append a header for the WikiStats section to the body content
$('#bodyContent').append('<h2>WikiStats</h2>');

// Append a paragraph displaying the page name
$('#bodyContent').append('<p>Page Name: ' + pagename + '</p>');

// Append a link to see detailed statistics about the page
$('#bodyContent').append('<a href="https://en.wikipedia.org/w/index.php?title=' + pagename + '&action=info">See Statistics</a>');

// Append a line break for formatting
$('#bodyContent').append('<br>');

// Append a link to see additional page information using XTools
$('#bodyContent').append('<a href="https://xtools.wmcloud.org/pageinfo/en.wikipedia.org/' + pagename + '">See XTools</a>');