(function () {
if (mw.config.get('wgAction') !== 'view') return;
var infoPage = mw.util.getUrl(mw.config.get('wgPageName'), { action: 'info', useLang: 'en' })
$.ajax({
url: infoPage,
type: 'get',
success: function (html) {
var text = $(html).find('table').text()
var monthlyViews = text.match(/Page views in the past 30 days(.+)/)
var visitingwatchers = text.match(/Number of page watchers who visited recent edits(.+)/)
var floatRight = $('#coordinates').length === 0
$('#siteSub').append(`<span style="font-size: 12px; ${floatRight ? 'float:right;':''}color: #969696;">
${monthlyViews ? `<a href="https://tools.wmflabs.org/pageviews/?project=en.wikipedia.org&range=latest-20&pages=${mw.config.get('wgPageName')}" style="color: black;">/ ${monthlyViews[1]} monthly views</a>`:''}${visitingwatchers && monthlyViews ? ',':''}
${visitingwatchers ? `<a href="${infoPage}" style="color: gray;">${visitingwatchers[1]} active watchers</a>`:''}
</div>`)
}
})
})()