This tool is a variant of baGLAMa2. It can show the view number of pages that include files from a specific Commons category. Human views only, article namespace only. 30K files max in category tree. This tool is run "live", so it may take a while to run.
Image | Image title | Views | Used on pages | |||
---|---|---|---|---|---|---|
"+getWikiLink('commonswiki','File:'+file.page_title)+" | " ; h += ""+prettyNumber(file.views)+" | " ; h += "" ;
if ( file.pages.length > 0 ) {
var tmp2 = [] ;
$.each ( file.pages , function ( k2 , v2 ) { tmp2.push ( k2 ) } ) ;
tmp2 = tmp2.sort ( function ( a , b ) {
return pages[file.pages[b]].views - pages[file.pages[a]].views ;
} ) ;
h += " " ;
h += " " ;
}
h += "
| " ;
h += "
Wiki | Images used |
---|---|
" + wiki + " | " ; h += "" + prettyNumber(stats.used_by_wiki[wiki]) + " | " ; h += "
Download " ; h += "files,pages,pageviews, and file usage | " ; h += "files, and file usage" ; h += "
" ; } $('#output').html ( h ) ; showViewsPerFile ( initial_top_view ) ; $('#download_all').click ( function () { var out = [ "file\tpage_wiki\tpage_title\tpage_views\tfile_views\n" ] ; $.each ( files , function ( k , file ) { if ( file.pages.length == 0 ) { out.push ( file.page_title+"\n" ) ; } else { $.each ( file.pages , function ( dummy , page_key ) { out.push ( file.page_title + "\t" + pages[page_key].wiki + "\t" + pages[page_key].page + "\t" + (pages[page_key].views||0) + "\t" + file.views + "\n" ) ; } ) ; } } ) ; var blob = new Blob(out, {type: "text/plain;charset=utf-8"}); saveAs(blob, day1+".txt"); return false ; } ) ; $('#download_files').click ( function () { var out = [ "file\tpages\tfile_views\n" ] ; $.each ( files , function ( k , file ) { out.push ( file.page_title + "\t" + file.pages.length + "\t" + file.views + "\n" ) ; } ) ; var blob = new Blob(out, {type: "text/plain;charset=utf-8"}); saveAs(blob, day1+".txt"); return false ; } ) ; } $(document).ready ( function () { $('#category').focus() ; $('#demo').click ( function () { $('#category').val ( 'Europeana 1989' ) ; $('#theform').submit() ; return false ; } ) ; $('#theform').submit ( function () { var category = $('#category').val() ; var depth = $('#depth').val()*1 ; var year = $('#year').val()*1 ; var month = $('#month').val()*1 ; var s_month = (monthThe pageview API does not currently contain data before 2015-08.' ; return false ; } day1 = ''+year+s_month+'01' ; day2 = ''+year+s_month+daysInMonth(year,month) ; pages = {} ; files = {} ; $('#output').html ( '' ) ; $('#status').html("Loading file usage data...") ; $('#status').show() ; loadFileUsage ( category , depth , function () { // Generate page list $.each ( files , function ( file_id , file ) { file.pages = [] ; $.each ( (file.giu||[]) , function ( dummy , page ) { if ( page.ns != 0 ) return ; page.key = page.wiki+':'+page.page ; if ( typeof pages[page.key] == 'undefined' ) { pages[page.key] = page ; pages[page.key].files = [] ; pages[page.key].views = 0 ; } pages[page.key].files.push ( ''+file_id ) ; file.pages.push ( page.key ) ; } ) ; } ) ; loadPageViews ( function () { $('#status').hide() ; showResults() ; } ) ; } ) ; // Logging $.getJSON ( 'https://tools.wmflabs.org/magnustools/logger.php?tool=glamorgan&method=run&callback=?' , function(j){} ) ; return false ; } ) ; var date = new Date(); var year = date.getFullYear() ; var last_month = date.getMonth() - 1 ; if ( last_month