Template talk:Popular articles

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

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[edit]

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

Filtering of non-existent pages could be done by using:

{{subst:#ifexist:Talk|
# [[Talk]]| }}

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)[reply]

Could deleted pages be removed from the mix? The Mind's Eye (talk) 15:42, 9 August 2008 (UTC)[reply]
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)[reply]
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)[reply]

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)[reply]

Issue with total newbs[edit]

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)[reply]

MelancholieBot does sight each edit, so the template is up-2-date for everyone :-) --- Greetings, Melancholie (talk) 20:47, 13 September 2008 (UTC)[reply]

Comparisions[edit]

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; ↑ 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)[reply]

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)[reply]
I don't know actually. Maybe percent as it kind of gives more of the Bigger Picture. Bawolff 07:51, 5 February 2009 (UTC)[reply]
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 Article XY (140 hits; ↑ 19 hits over avg) 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)[reply]
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)[reply]

Discrepency between FF and Safari/IE[edit]

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.

<div style="float: right; margin: -5px 0 -2px 0;">
<small>[[Template:Popular_articles|» more]]</small>
</div>

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)[reply]

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):

Stats updated hourly.

<div style="float: right;">
<small>[[Template:Popular_articles|» more]]</small>
</div>
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)[reply]

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)[reply]
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)[reply]
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 </ol><p>... will still make it looking non-aligned. --- Kind regards, Melancholie (talk) 12:24, 17 June 2009 (UTC)[reply]

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 {{Popular_articles|...|nolink=true}} 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)[reply]

Spelling mistake?[edit]

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)[reply]

I've fixed it, thanks for pointing this out. Cheers, Tempodivalse [talk] 19:07, 15 June 2009 (UTC)[reply]
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)[reply]

Why on earth?[edit]

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)[reply]

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)[reply]

fixed a bug[edit]

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)[reply]

Bot hates articles with á-é-í-ó-ú[edit]

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)[reply]

Bot is shitty... Bawolff 15:41, 10 July 2013 (UTC)[reply]

Displaying extra curly brackets in Main Page[edit]

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)[reply]

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)[reply]
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)[reply]
Thank you Bawolff! I hope <span style="font-size:0; color:transparent;">}} }} }} }} }} }} }} }} }} }} }} }} }} }} }} </span> 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)[reply]

Date frame[edit]

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)[reply]

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)[reply]