Ironholds / WikipediR

R's MediaWiki API client library
Other
68 stars 18 forks source link

Random page #18

Closed bitowaqr closed 7 years ago

bitowaqr commented 7 years ago

Hi,

Any thoughts on how I could get the page count for a random page?

I am trying to normalize the view count for a specific page, but I don't think think the main page view count is a good proxy. The project's total views could work, but from what I understand this figure is only available in the new API. This is why I thought a collection of random pages (https://en.wikipedia.org/wiki/Special:Random) would be great. Could I use WikipediR for this?

Thank you!

okeyes-r7 commented 7 years ago

Heya,

the new pageviews API actually has a package at https://github.com/ironholds/pageviews - you can use that to get overall project pageviews!

bitowaqr commented 7 years ago

Thank you. I know- Overall project page views work well from 2016 onwards, but what do I do with older observations?

okeyes-r7 commented 7 years ago

So, relying on the pre-2016 pagecounts? Honestly I think the methodological differences there are large enough that you're going to end up with some extremely unreliable data - the old API has an old definition of 'pageview', one that is very different and overcounts substantially :(

bitowaqr commented 7 years ago

Problem solved. Not sure how I could miss this: https://www.mediawiki.org/wiki/API:Random/de

Ironholds commented 7 years ago

Yeah, I mean if you literally just want to grab random pages, WikipediR::random_page(...). I still wouldn't rely on the pre-2016 data on them, though!