Template talk:Popular articles

''It's based on the number of visits to each page over the last hour. The statistics include all visits, both people and automated computer programs ones. Although these are probably reasonably accurate, they are easy to distort.''

To be filtered out

 * /:[^_ ]/ (non-articlesx)
 * 1) Main Page
 * 2) Talk
 * 3) User talk
 * 4) Category
 * 5) Template
 * 6) Portal
 * 7) Wikinews

Filtering of non-existent pages could be done by using: But maybe the best way would be to just use this page for example as blacklist, as deleted redirects e.g. would also be filtered with #ifexist? --Melancholie (talk) 15:38, 9 August 2008 (UTC)
 * 1) Talk
 * Could deleted pages be removed from the mix? The Mind&#39;s Eye (talk) 15:42, 9 August 2008 (UTC)
 * The problem is, that pages got hits (were viewed) before they got moved and deleted, thus figures would be incorrect. But nevertheless, they should get filtered out, as red links are ugly, yes ;-) --- Regards, Melancholie (talk) 15:54, 9 August 2008 (UTC)
 * It might be useful to have the hit count for the main page listed. Also some of the issues with colon could be avoided by filtering out the regex /^[a-z]{2,3}:[^_]/ as most interwiki prefixes are 2-3 latin lowercase letters. (However this doesn't include stuff that start with wikipedia: or w:, however very few of thoose are actually in the hit list, as most of the urls are fixed before hand). Bawolff ☺☻ 08:02, 29 January 2009 (UTC)

-- In case anyone cares, the current filter list changed to be anything that matches the following regex: (^Main_Page)|(^Talk:)|(^User:)|(^User_talk:)|(^Wikinews:)|(^Wikinews_talk:)|(^Category:)|(^Category talk:)|(^File:)|(^File talk:)|(^Special:)|(&)|(.png$)|(^en:)|(^Http:)/ Additionally, any pages that make it through this are checked to see if they're in category published. I just added .png to this list as we now get image stats, and the script only checks the top 45 pages on the list against cat publish, so all the extra high ranking pages was screwing things up. Bawolff ☺☻ 04:12, 10 November 2010 (UTC)

Issue with total newbs
Does this work for people who are not logged in? Or should it be sighted when updated? --Brian McNeil / talk 19:31, 11 September 2008 (UTC)
 * MelancholieBot does sight each edit, so the template is up-2-date for everyone :-) --- Greetings, Melancholie (talk) 20:47, 13 September 2008 (UTC)

Comparisions
Would it be possible to compare hit totals to an average for that time of day for that day of week. So for example, if on monday at 7:00 UTC the average hit total for the number 2 spot was 121 hits. and currently it had 140 hits, the entry might say (140 hits; &uarr; 19 hits over avg), perhaps borrowing the arrows from stock templates. This way we could see approximatively if we are sucking or not at a specific moment in time. Bawolff ☺☻ 07:40, 29 January 2009 (UTC)
 * That's a cool idea! Adding up-/down trend shouldn't be a problem, actually. What's better, percents or hits? --- Best regards, Melancholie (talk) 09:30, 3 February 2009 (UTC)
 * I don't know actually. Maybe percent as it kind of gives more of the Bigger Picture. Bawolff ☺☻ 07:51, 5 February 2009 (UTC)


 * First, note that there is also a chart for the overall traffic, by the way. I am not sure though where to place your suggested figures here. On one hand it would be cool to show passers-by if the no. 1 articles is a popular one or not, on the other hand  just looks like "Article XY" would have improved by 19 hits (another thing in planning). It would only be interesting/obvious for the top articles of a day (see linked chart) anyway, maybe top 15 hits? I may provide something like this :-) --- Kind regards, Melancholie (talk) 03:20, 11 April 2009 (UTC)
 * Hmm, I don't know how it would be best be displayed. One approach is to abstract this all away in the template, and then we could figure out how to display it (on wiki) as we go. Bawolff ☺☻ 02:10, 13 June 2009 (UTC)

Discrepency between FF and Safari/IE
I noticed that Firefox and Safari do not show the Main Page's version of this template the same. In Firefox, the ">> more" and "Stats updated hourly" text lines up fairly well, though it not exactly. However, in Safari and Internet Explorer, the ">>more" text is much higher than the "stats updated" text. This seems to be difference in how the below code is interpreted by the browser.

» more

I would therefore assume that it would be better recode this bit so that the text is displayed in the correct place every time and perhaps to include the bit about the stats being updated hourly within the template rather than outside of the template on the main page. Calebrw (talk) 23:31, 12 June 2009 (UTC)
 * Probably should use different units (em's instead of px's). In a broader way this could probably be coded like (example in red border):

- » more Stats updated hourly. » more Stats updated hourly.

However reading the code, it looks almost as if the intention was to line it up with the last article on the pop articles list rather than the updated hourly line. Bawolff ☺☻ 02:19, 13 June 2009 (UTC)
 * That may be true, but who ever coded the Template didn't know that the updated hourly line was coming (at least I assume they didn't), but I do think they should line up. Calebrw (talk) 04:14, 13 June 2009 (UTC)


 * Yes you both are right, the "updated hourly" line was added later, the intention was to get the "> more" closer to the list for not producing a too enormous extra line. For me, FF and IE both show the same, "> more" being between the last list item and "updated hourly", looking quite acceptable. Konqueror shows it, probably like Safari, even a little bit higher than the last list item. We try em instead of px or can make it go into the same line with "updated hourly" if removing it from the template and placing it into the main page; shall we do so? Note that this template is not only used in the Main_Page but other pages too where it might be nice to have a "> more" too, see transclusions (e.g. see my user page). --- Best regards, Melancholie (talk) 12:12, 17 June 2009 (UTC)


 * I will put the "> more" link into Template:Popular_articles/bottom after removing it for the bot. Then we can act in a more flexible fashion, because just stating "float: right" (talking about template, not Main_Page) will help Safari, but the resulting  ... will still make it looking non-aligned. --- Kind regards, Melancholie (talk) 12:24, 17 June 2009 (UTC)

Safari issue fixed by adding a line break, so the wiki software will properly close the list item tag before. For the Main_Page you can add  e.g. to hide the content of Template:Popular_articles/link and use some own now. --- Kind regards, Melancholie (talk) 17:31, 23 June 2009 (UTC)

Spelling mistake?
Can't find which bit to edit-but it says watch changes of that most visited articles-that doesn't seemt the right word? Dottydotdot (talk) 19:01, 15 June 2009 (UTC)
 * I've fixed it, thanks for pointing this out. Cheers, Tempodivalse [talk]  19:07, 15 June 2009 (UTC)
 * Oops, right. It should have been "those" or just nothing, not singular "that" ;-) --- Sorry for that glitch, Melancholie (talk) 11:40, 17 June 2009 (UTC)

Why on earth?
Why on earth do people (or automated things) love that sexy video clips article so much? It's from years back. --Shankarnikhil88 (talk) 16:49, 3 August 2010 (UTC)
 * sex sells. Probably linked from somewhere semi-prominant. We still have low enough traffic that something linked in a prominant place from a while back can influence this. Bawolff ☺☻ 17:02, 3 August 2010 (UTC)

fixed a bug
There was an issue where it wouldn't list all 15 top articles (in extreme cases it would list 0 articles). This was caused by my script not escaping ampersands properly, and the fact the page & for some unknown reason has a lot of hits... Bawolff bot (talk) 23:39, 29 October 2010 (UTC)

Bot hates articles with á-é-í-ó-ú
I don't know, but the Copiapó article hasn't appeared. The in depth article that was published a month ago didn't appear either. Diego Grez return fire 13:25, 10 November 2010 (UTC)
 * Bot is shitty... Bawolff ☺☻ 15:41, 10 July 2013 (UTC)

Displaying extra curly brackets in Main Page
This template now only shows top 9 articles, but earlier had 14 articles. When the bot updated it, it didn't removed the 5 pair of closing brackets at the end (it should be 9 but has 14). This causes the display of 5 closing curly brackets in the Main Page. Can we remove it; and if we remove, will it affect the bot's activity? Vanischenu (talk) 09:05, 10 July 2013 (UTC)
 * Now the bot added 3 more articles, hence only two curly brackets. That means we should not do it manuallyVanischenu (talk) 09:28, 10 July 2013 (UTC)
 * The bot is hacky. If there is less than 15 published articles being viewed, the output has extra brackets. Traditionally this has only been a problem on projects like fawikinews. Any edits you make to the template will be overwritten by the bot once an hour. Bawolff ☺☻ 15:40, 10 July 2013 (UTC)
 * Thank you Bawolff! I hope  will hide it (for most browsers, I think). Would it be technically possible to make the bot add it?Vanischenu (talk) 19:10, 15 November 2013 (UTC)

Date frame
Are the popular articles supposed to only include fresh stuff (i.e. most popular out of the articles for the last week)? I'm not sure counting the visits of archived articles has a lot of merit - people are supposed to be reading news in the first place. Just a thought. Gryllida 22:34, 1 October 2014 (UTC)
 * Hm. For my part, I find it interesting to know what people are reading in the archives.  Our archives are a major asset of the project.  --Pi zero (talk) 23:05, 1 October 2014 (UTC)