Index: trunk/wikistats/dumps/WikiReports.pl |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | # push @arguments, '-v n' ; # generate tables with pageviews per wiki: non-mobile traffic
|
30 | 30 | # e.g. http://stats.wikimedia.org/EN/TablesPageViewsMonthlyMobile.htm
|
31 | 31 | # mutually exclusive with other reporting
|
32 | | - push @arguments, '-v c' ; # generate tables with pageviews per wiki: mobile + non-mobile traffic
|
| 32 | + # push @arguments, '-v c' ; # generate tables with pageviews per wiki: mobile + non-mobile traffic
|
33 | 33 | # e.g. http://stats.wikimedia.org/EN/TablesPageViewsMonthlyCombined.htm
|
34 | 34 | # mutually exclusive with other reporting
|
35 | 35 | # push @arguments, '-n' ; # normalize monthly page view data (see -v) to 30 days for each month
|
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | # push @arguments, '-c' ; # generate category trees
|
41 | 41 | # mutually exclusive with other reporting
|
42 | 42 |
|
43 | | - # push @arguments, '-r india' ; # only one region per run, no region specified -> all languages
|
| 43 | + push @arguments, '-r india' ; # only one region per run, no region specified -> all languages
|
44 | 44 | # push @arguments, '-r africa' ;
|
45 | 45 | # push @arguments, '-r america' ;
|
46 | 46 | # push @arguments, '-r asia' ;
|
— | — | @@ -206,11 +206,11 @@ |
207 | 207 | else
|
208 | 208 | { &GenerateSiteMap ; }
|
209 | 209 |
|
210 | | - if ($mode_wp && ($language eq "en"))
|
211 | | - {
|
212 | | - &LogT ("\nGenerate Summaries Per Wiki") ;
|
213 | | - &GenerateSummariesPerWiki ;
|
214 | | - }
|
| 210 | + if ($mode_wp && ($language eq "en"))
|
| 211 | + {
|
| 212 | + &LogT ("\nGenerate Summaries Per Wiki") ;
|
| 213 | + &GenerateSummariesPerWiki ;
|
| 214 | + }
|
215 | 215 |
|
216 | 216 | # &GenerateTablesPerWiki ("zz") ;
|
217 | 217 | # &GenerateComparisonTables ;
|
— | — | @@ -257,7 +257,7 @@ |
258 | 258 | &LogT ("\nGenerate Comparison Tables") ;
|
259 | 259 | &GenerateComparisonTables ;
|
260 | 260 |
|
261 | | -# $showplots = $false ; # for test only
|
| 261 | + # $showplots = $false ; # for test only
|
262 | 262 |
|
263 | 263 | if ($showplots)
|
264 | 264 | {
|
— | — | @@ -270,16 +270,19 @@ |
271 | 271 | &GeneratePlotFiles ;
|
272 | 272 | }
|
273 | 273 |
|
274 | | - &LogT ("\nGenerate Wiki Specific Tables") ;
|
275 | | - &GenerateWikiSpecificTables ;
|
276 | | - if ($mode_wp)
|
277 | | - { &GenerateTablesPerWiki ("zzz") ; }
|
| 274 | + if ((! $mode_wp) || ($region eq ''))
|
| 275 | + {
|
| 276 | + &LogT ("\nGenerate Wiki Specific Tables") ;
|
| 277 | + &GenerateWikiSpecificTables ;
|
| 278 | + if ($mode_wp)
|
| 279 | + { &GenerateTablesPerWiki ("zzz") ; }
|
278 | 280 |
|
279 | | - &LogT ("\nGenerate Wikipedia Specific Charts" ) ;
|
280 | | - foreach $wp (@languages)
|
281 | | - { &GenerateChartsPerWikipedia ($wp) ; }
|
282 | | - if ($mode_wp)
|
283 | | - { &GenerateChartsPerWikipedia ("zzz") ; }
|
| 281 | + &LogT ("\nGenerate Wikipedia Specific Charts" ) ;
|
| 282 | + foreach $wp (@languages)
|
| 283 | + { &GenerateChartsPerWikipedia ($wp) ; }
|
| 284 | + if ($mode_wp)
|
| 285 | + { &GenerateChartsPerWikipedia ("zzz") ; }
|
| 286 | + }
|
284 | 287 |
|
285 | 288 | # &GenerateChartsPerWikipedia ("zz") ;
|
286 | 289 | # &GenerateChartsPerWikipedia ("en") ;
|
Index: trunk/wikistats/dumps/WikiReportsOutputSummaries.pm |
— | — | @@ -173,33 +173,33 @@ |
174 | 174 |
|
175 | 175 | # page views
|
176 | 176 |
|
177 | | - $daysinmonth = days_in_month (substr ($mmddyyyy,6,4), substr ($mmddyyyy,0,2)) ;
|
178 | | - $pageviews = sprintf ("%.0f", ($PageViewsPerHour {$wp} * 24 * 30)) ; # use normalized count (month always 30 days)
|
179 | | - $pageviews_day = $pageviews / 30 ; # $daysinmonth ;
|
180 | | - $pageviews_hour = $pageviews_day / 24 ;
|
181 | | - $pageviews_min = $pageviews_day / (24 * 60) ;
|
182 | | - $pageviews_sec = $pageviews_day / (24 * 60 * 60) ;
|
| 177 | + $daysinmonth = days_in_month (substr ($mmddyyyy,6,4), substr ($mmddyyyy,0,2)) ;
|
| 178 | + $pageviews_month = sprintf ("%.0f", ($PageViewsPerHour {$wp} * 24 * 30)) ; # use normalized count (month always 30 days)
|
| 179 | + $pageviews_day = $pageviews_month / 30 ; # $daysinmonth ;
|
| 180 | + $pageviews_hour = $pageviews_day / 24 ;
|
| 181 | + $pageviews_min = $pageviews_day / (24 * 60) ;
|
| 182 | + $pageviews_sec = $pageviews_day / (24 * 60 * 60) ;
|
183 | 183 |
|
184 | | - $this_month = $pageviews ;
|
| 184 | + $this_month = $pageviews_month ;
|
185 | 185 | $metric_PV_yearly = "--" ;
|
186 | 186 | $metric_PV_monthly = "--" ;
|
187 | 187 |
|
188 | | - print "DAYSINMONTH $month_year: $daysinmonth, PAGEVIEWS $pageviews\n" ;
|
| 188 | + print "DAYSINMONTH $month_year: $daysinmonth, PAGEVIEWS $pageviews_month\n" ;
|
189 | 189 |
|
190 | 190 | $metric_PV_data = &FormatSummary ($this_month) ;
|
191 | 191 |
|
192 | | - $pageviews = &format($pageviews,'X') ;
|
193 | | - $pageviews_day = &format($pageviews_day,'X') ;
|
194 | | - $pageviews_hour = &format($pageviews_hour,'X') ;
|
195 | | - $pageviews_min = &format($pageviews_min,'X') ;
|
196 | | - $pageviews_sec = &format($pageviews_sec,'X') ;
|
| 192 | + $pageviews_month = &format($pageviews_month,'X') ;
|
| 193 | + $pageviews_day = &format($pageviews_day,'X') ;
|
| 194 | + $pageviews_hour = &format($pageviews_hour,'X') ;
|
| 195 | + $pageviews_min = &format($pageviews_min,'X') ;
|
| 196 | + $pageviews_sec = &format($pageviews_sec,'X') ;
|
197 | 197 |
|
198 | 198 | if ($pageviews_sec >= 1)
|
199 | | - { $pageviews_per_unit = "$pageviews/month = $pageviews_day /day = $pageviews_hour /hour = $pageviews_min /minute = $pageviews_sec /second" ; }
|
| 199 | + { $pageviews_per_unit = "$pageviews_month/month = $pageviews_day /day = $pageviews_hour /hour = $pageviews_min /minute = $pageviews_sec /second" ; }
|
200 | 200 | elsif ($pageviews_min >= 1)
|
201 | | - { $pageviews_per_unit = "$pageviews/month = $pageviews_day /day = $pageviews_hour /hour = $pageviews_min /minute" ; }
|
| 201 | + { $pageviews_per_unit = "$pageviews_month/month = $pageviews_day /day = $pageviews_hour /hour = $pageviews_min /minute" ; }
|
202 | 202 | else
|
203 | | - { $pageviews_per_unit = "$pageviews/month = $pageviews_day /day = $pageviews_hour /hour " ; }
|
| 203 | + { $pageviews_per_unit = "$pageviews_month/month = $pageviews_day /day = $pageviews_hour /hour " ; }
|
204 | 204 | $pageviews_per_unit =~ s/M/million/g ;
|
205 | 205 | $pageviews_per_unit =~ s/k/thousand/g ;
|
206 | 206 | $pageviews_per_unit =~ s/\// per /g ;
|
Index: trunk/wikistats/dumps/WikiReportsOutputTables.pm |
— | — | @@ -3180,34 +3180,37 @@ |
3181 | 3181 |
|
3182 | 3182 | my $content = &GenerateHtmlStartComparisonTables ($f, $normalize_days_per_month) ;
|
3183 | 3183 |
|
3184 | | - if ($pageviews_mobile)
|
| 3184 | + if ($pageviews)
|
3185 | 3185 | {
|
3186 | | - $href_normalized = 'TablesPageViewsMonthlyMobile.htm' ;
|
3187 | | - $href_not_normalized = 'TablesPageViewsMonthlyOriginalMobile.htm' ;
|
3188 | | - }
|
3189 | | - elsif ($pageviews_non_mobile)
|
3190 | | - {
|
3191 | | - $href_normalized = 'TablesPageViewsMonthly.htm' ;
|
3192 | | - $href_not_normalized = 'TablesPageViewsMonthlyOriginal.htm' ;
|
3193 | | - }
|
3194 | | - else
|
3195 | | - {
|
3196 | | - $href_normalized = 'TablesPageViewsMonthlyCombined.htm' ;
|
3197 | | - $href_not_normalized = 'TablesPageViewsMonthlyOriginalCombined.htm' ;
|
3198 | | - }
|
3199 | | - $href_normalized2 = 'TablesPageViewsMonthlyCombined.htm' ;
|
3200 | | - $href_not_normalized2 = 'TablesPageViewsMonthlyOriginalCombined.htm' ;
|
| 3186 | + if ($pageviews_mobile)
|
| 3187 | + {
|
| 3188 | + $href_normalized = 'TablesPageViewsMonthlyMobile.htm' ;
|
| 3189 | + $href_not_normalized = 'TablesPageViewsMonthlyOriginalMobile.htm' ;
|
| 3190 | + }
|
| 3191 | + elsif ($pageviews_non_mobile)
|
| 3192 | + {
|
| 3193 | + $href_normalized = 'TablesPageViewsMonthly.htm' ;
|
| 3194 | + $href_not_normalized = 'TablesPageViewsMonthlyOriginal.htm' ;
|
| 3195 | + }
|
| 3196 | + elsif ($pageviews_combined)
|
| 3197 | + {
|
| 3198 | + $href_normalized = 'TablesPageViewsMonthlyCombined.htm' ;
|
| 3199 | + $href_not_normalized = 'TablesPageViewsMonthlyOriginalCombined.htm' ;
|
| 3200 | + }
|
| 3201 | + $href_normalized2 = 'TablesPageViewsMonthly.htm' ;
|
| 3202 | + $href_not_normalized2 = 'TablesPageViewsMonthlyOriginal.htm' ;
|
3201 | 3203 |
|
3202 | | - if ($normalize_days_per_month)
|
3203 | | - {
|
3204 | | - $href_current_file = $href_normalized ;
|
3205 | | - $href_current_file2 = $href_normalized2 ;
|
| 3204 | + if ($normalize_days_per_month)
|
| 3205 | + {
|
| 3206 | + $href_current_file = $href_normalized ;
|
| 3207 | + $href_current_file2 = $href_normalized2 ;
|
| 3208 | + }
|
| 3209 | + else
|
| 3210 | + {
|
| 3211 | + $href_current_file = $href_not_normalized ;
|
| 3212 | + $href_current_file2 = $href_not_normalized2 ;
|
| 3213 | + }
|
3206 | 3214 | }
|
3207 | | - else
|
3208 | | - {
|
3209 | | - $href_current_file = $href_not_normalized ;
|
3210 | | - $href_current_file2 = $href_not_normalized2 ;
|
3211 | | - }
|
3212 | 3215 |
|
3213 | 3216 | if ($wikimedia && ($f <= 1) && $mode_wp)
|
3214 | 3217 | {
|
— | — | @@ -3267,6 +3270,9 @@ |
3268 | 3271 | $raw_or_not = "Raw Data, " ;
|
3269 | 3272 | }
|
3270 | 3273 |
|
| 3274 | + $out_html .= "<p><a href='http://stats.wikimedia.org/EN/TablesPageViewsSitemap.htm'>Site map for all page view reports</a><p>" ;
|
| 3275 | +
|
| 3276 | +
|
3271 | 3277 | if ($normalize_days_per_month)
|
3272 | 3278 | {
|
3273 | 3279 | $out_html .= "<p>Switch to $coverage1$coverage2<a href='$href_not_normalized'>Raw Data</a>" ;
|
Index: trunk/wikistats/dumps/WikiCountsSummarizeProjectCounts.pl |
— | — | @@ -75,6 +75,7 @@ |
76 | 76 | $count = $totals {"month"} {$project} {$key} ;
|
77 | 77 |
|
78 | 78 | next if $project eq 'wx' and $lang ne 'commons' ;
|
| 79 | +
|
79 | 80 | if ($lang eq 'commons')
|
80 | 81 | { $project2 = 'Commons' ; }
|
81 | 82 | elsif ($lang =~ /\.m/)
|
— | — | @@ -89,17 +90,21 @@ |
90 | 91 | $projects3 {$project3}++ ;
|
91 | 92 | $projects3 {'all'}++ ;
|
92 | 93 |
|
93 | | - $totals_project {"month"} {$project2} {$date} += $count ;
|
94 | | - if ($totals_project {"month"} {$project2} {$date} > $totals_project_max {"month"} {$project2})
|
95 | | - { $totals_project_max {"month"} {$project2} = $totals_project {"month"} {$project2} {$date} ; }
|
| 94 | + # split is mobile or non-mobile
|
| 95 | + # combined is mobile plus non-mobile views for one project
|
| 96 | + # all = views for all wikis from all projects
|
96 | 97 |
|
97 | | - $totals_project {"month"} {"$project3"} {$date} += $count ;
|
98 | | - if ($totals_project {"month"} {$project3} {$date} > $totals_project_max {"month"} {$project3})
|
99 | | - { $totals_project_max {"month"} {$project3} = $totals_project {"month"} {$project3} {$date} ; }
|
| 98 | + # $totals_project_month_split {$project2} {$date} += $count ;
|
| 99 | + # if ($totals_project_month_split {$project2} {$date} > $totals_project_month_split_max {$project2})
|
| 100 | + # { $totals_project_month_split_max {$project2} = $totals_project_month_split {$project2} {$date} ; }
|
100 | 101 |
|
101 | | - $totals_project {"month"} {'all'} {$date} += $count ;
|
102 | | - if ($totals_project {"month"} {'all'} {$date} > $totals_project_max {"month"} {'all'})
|
103 | | - { $totals_project_max {"month"} {'all'} = $totals_project {"month"} {'all'} {$date} ; }
|
| 102 | + $totals_project_month_combined {"$project3"} {$date} += $count ;
|
| 103 | + if ($totals_project_month_combined {$project3} {$date} > $totals_project_month_combined_max {$project3})
|
| 104 | + { $totals_project_month_combined_max {$project3} = $totals_project_month_combined {$project3} {$date} ; }
|
| 105 | +
|
| 106 | + $totals_project_month_combined {"all"} {$date} += $count ;
|
| 107 | + if ($totals_project_month_combined {"all"} {$date} > $totals_project_month_combined_max {"all"})
|
| 108 | + { $totals_project_month_combined_max {"all"} = $totals_project_month_combined {"all"} {$date} ; }
|
104 | 109 | }
|
105 | 110 | }
|
106 | 111 |
|
— | — | @@ -304,8 +309,8 @@ |
305 | 310 | my ($month,$year) = (localtime(time))[4,5] ;
|
306 | 311 | my @months = qw(Xxx Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec) ;
|
307 | 312 |
|
308 | | -# $year = 110 ;
|
309 | | -# $month = 12 ;
|
| 313 | +# $year = 111 ;
|
| 314 | +# $month = 1 ;
|
310 | 315 |
|
311 | 316 | $year_now = $year + 1900 ;
|
312 | 317 | $month_now = $month + 1 ;
|
— | — | @@ -649,7 +654,7 @@ |
650 | 655 | next ;
|
651 | 656 | }
|
652 | 657 |
|
653 | | - # translate suffixes used in dammit.lt files into project codes often as used in wikistats
|
| 658 | + # translate suffixes used in dammit.lt files into project codes as used in wikistats
|
654 | 659 |
|
655 | 660 | if ($project eq "") { $project = "wp"; }
|
656 | 661 | elsif ($project eq "b") { $project = "wb"; } # wikibooks
|
— | — | @@ -741,10 +746,10 @@ |
742 | 747 | { $file_csv =~ s/\.csv/Normalized.csv/ ; }
|
743 | 748 | &Log ("File out: $file_out\n") ;
|
744 | 749 |
|
745 | | - if (-e "$dir_out/PageViewsPerHourAll.csv")
|
| 750 | + if (-e "$dir_out/PageViewsPerHourAll.csv") # huge file, remove for now, reactivate when really used
|
746 | 751 | {
|
747 | | - print "unlink $dir_out/PageViewsPerHourAll.csv (reactive when really used)\n" ;
|
748 | | - unlink "$dir_out/PageViewsPerHourAll.csv" ; # huge, file reactivate when really used
|
| 752 | + print "unlink $dir_out/PageViewsPerHourAll.csv (reactivate when really used)\n" ;
|
| 753 | + unlink "$dir_out/PageViewsPerHourAll.csv" ;
|
749 | 754 | }
|
750 | 755 |
|
751 | 756 | &Log ("File csv: $file_csv\n") ;
|
— | — | @@ -793,6 +798,62 @@ |
794 | 799 | print CSV "=== $msg_normalized ===\n" ;
|
795 | 800 | print "=== $msg_normalized ===\n" ;
|
796 | 801 |
|
| 802 | + print CSV "\n=== Page view totals non-mobile + mobile ===\n\n" ;
|
| 803 | + print "\n=== Page view totals non-mobile + mobile ===\n\n" ;
|
| 804 | +
|
| 805 | + print CSV ",,,,,,,," . $csv_recent_months ;
|
| 806 | + print $csv_recent_months ;
|
| 807 | +
|
| 808 | + # write per popular language+wiki recent months of page view totals
|
| 809 | + # non mobile + mobile
|
| 810 | + $lines = 0 ;
|
| 811 | + foreach $line (@totals_lastmonth)
|
| 812 | + {
|
| 813 | + next if $line =~ /\.m/ ;
|
| 814 | +
|
| 815 | + if (++$lines > $maxpopularwikis) { last ; }
|
| 816 | +
|
| 817 | + ($project, $language) = split (',', $line) ;
|
| 818 | + $largest_projects {"$project-$language"} ++ ;
|
| 819 | +
|
| 820 | + $language_name = $out_languages {$language} ;
|
| 821 | +
|
| 822 | + print CSV ",,,,,,,," ;
|
| 823 | +
|
| 824 | + if (($project ne "wp") && ($project ne "wx"))
|
| 825 | + {
|
| 826 | + print CSV "$language_name " . &GetProjectName ($project) . "," ;
|
| 827 | + print "$language_name " . &GetProjectName ($project) . "," ;
|
| 828 | + }
|
| 829 | + else
|
| 830 | + {
|
| 831 | + print CSV "$language_name," ;
|
| 832 | + print "$language_name," ;
|
| 833 | + }
|
| 834 | +
|
| 835 | +# %test = %{$totals {"month"} {"wp"} };
|
| 836 | +# %test2 = @recent_months ;
|
| 837 | + for ($m = 0 ; $m < $months_recent ; $m++)
|
| 838 | + {
|
| 839 | + print CSV ($totals {"month"} {$project} {"$language,${recent_months [$m]}"} +
|
| 840 | + $totals {"month"} {$project} {"$language\.m,${recent_months [$m]}"}) . "," ;
|
| 841 | + print ($totals {"month"} {$project} {"$language,${recent_months [$m]}"} +
|
| 842 | + $totals {"month"} {$project} {"$language\.m,${recent_months [$m]}"}) . "," ;
|
| 843 | + }
|
| 844 | +
|
| 845 | + if (($project ne "wp") && ($project ne "wx"))
|
| 846 | + {
|
| 847 | + print CSV "$language_name " . &GetProjectName ($project) . "\n" ;
|
| 848 | + print "$language_name " . &GetProjectName ($project) . "\n" ;
|
| 849 | + }
|
| 850 | + else
|
| 851 | + {
|
| 852 | + print CSV "$language_name\n" ;
|
| 853 | + print "$language_name\n" ;
|
| 854 | + }
|
| 855 | +
|
| 856 | + }
|
| 857 | +
|
797 | 858 | print CSV "\n=== Page view totals non-mobile ===\n\n" ;
|
798 | 859 | print "\n=== Page view totals non-mobile ===\n\n" ;
|
799 | 860 |
|
— | — | @@ -844,7 +905,6 @@ |
845 | 906 | print CSV "$language_name\n" ;
|
846 | 907 | print "$language_name\n" ;
|
847 | 908 | }
|
848 | | -
|
849 | 909 | }
|
850 | 910 |
|
851 | 911 | print CSV "\n=== Page view totals mobile ===\n\n" ;
|
— | — | @@ -853,10 +913,10 @@ |
854 | 914 | # write per popular language+wiki recent months of page view totals
|
855 | 915 | # mobile
|
856 | 916 | $lines = 0 ;
|
| 917 | +
|
857 | 918 | foreach $line (@totals_lastmonth)
|
858 | 919 | {
|
859 | 920 | next if $line !~ /\.m/ ;
|
860 | | -
|
861 | 921 | if (++$lines > $maxpopularwikis) { last ; }
|
862 | 922 | ($project, $language) = split (',', $line) ;
|
863 | 923 | $largest_projects {"$project-$language"} ++ ;
|
— | — | @@ -897,156 +957,156 @@ |
898 | 958 | }
|
899 | 959 | }
|
900 | 960 |
|
901 | | - print CSV "\n=== Page view totals indexed non-mobile ===\n\n" ;
|
902 | | - print "\n=== Page view totals indexed non-mobile ===\n\n" ;
|
| 961 | +# print CSV "\n=== Page view totals indexed non-mobile ===\n\n" ;
|
| 962 | +# print "\n=== Page view totals indexed non-mobile ===\n\n" ;
|
903 | 963 |
|
904 | | - print CSV ",,,,,,,," . "$csv_recent_months" ;
|
905 | | - print "$csv_recent_months" ;
|
| 964 | +# print CSV ",,,,,,,," . "$csv_recent_months" ;
|
| 965 | +# print "$csv_recent_months" ;
|
906 | 966 |
|
907 | | - # write per popular language+wiki recent months of page view totals, normalized to first month = 100
|
908 | | - # non mobile
|
909 | | - $lines = 0 ;
|
910 | | - foreach $line (@totals_lastmonth)
|
911 | | - {
|
912 | | - next if $line =~ /\.m/ ;
|
913 | | - if (++$lines > $maxpopularwikis) { last ; }
|
| 967 | +# # write per popular language+wiki recent months of page view totals, normalized to first month = 100
|
| 968 | +# # non mobile
|
| 969 | +# $lines = 0 ;
|
| 970 | +# foreach $line (@totals_lastmonth)
|
| 971 | +# {
|
| 972 | +# next if $line =~ /\.m/ ;
|
| 973 | +# if (++$lines > $maxpopularwikis) { last ; }
|
914 | 974 |
|
915 | | - ($project, $language) = split (',', $line) ;
|
916 | | - $language_name = $out_languages {$language} ;
|
| 975 | +# ($project, $language) = split (',', $line) ;
|
| 976 | +# $language_name = $out_languages {$language} ;
|
917 | 977 |
|
918 | | - if (($project ne "wp") && ($project ne "wx"))
|
919 | | - { print CSV ",,,,,,,," . "$language_name " . &GetProjectName ($project) . "," ; }
|
920 | | - else
|
921 | | - { print CSV ",,,,,,,," . "$language_name," ; }
|
| 978 | +# if (($project ne "wp") && ($project ne "wx"))
|
| 979 | +# { print CSV ",,,,,,,," . "$language_name " . &GetProjectName ($project) . "," ; }
|
| 980 | +# else
|
| 981 | +# { print CSV ",,,,,,,," . "$language_name," ; }
|
922 | 982 |
|
923 | | - $recent_month_0 = $totals {"month"} {$project} {"$language,${recent_months [ 0]}"} ;
|
924 | | - for ($m = 0 ; $m < $months_recent ; $m++)
|
925 | | - {
|
926 | | - if ($recent_month_0 > 0)
|
927 | | - {
|
928 | | - print CSV sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
929 | | - print sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
930 | | - }
|
931 | | - else
|
932 | | - {
|
933 | | - print CSV "," ;
|
934 | | - print "," ;
|
935 | | - }
|
936 | | - }
|
| 983 | +# $recent_month_0 = $totals {"month"} {$project} {"$language,${recent_months [ 0]}"} ;
|
| 984 | +# for ($m = 0 ; $m < $months_recent ; $m++)
|
| 985 | +# {
|
| 986 | +# if ($recent_month_0 > 0)
|
| 987 | +# {
|
| 988 | +# print CSV sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
| 989 | +# print sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
| 990 | +# }
|
| 991 | +# else
|
| 992 | +# {
|
| 993 | +# print CSV "," ;
|
| 994 | +# print "," ;
|
| 995 | +# }
|
| 996 | +# }
|
937 | 997 |
|
938 | | - if (($project ne "wp") && ($project ne "wx"))
|
939 | | - { print CSV "$language_name " . &GetProjectName ($project) . "\n" ; }
|
940 | | - else
|
941 | | - { print CSV "$language_name\n" ; }
|
942 | | - }
|
| 998 | +# if (($project ne "wp") && ($project ne "wx"))
|
| 999 | +# { print CSV "$language_name " . &GetProjectName ($project) . "\n" ; }
|
| 1000 | +# else
|
| 1001 | +# { print CSV "$language_name\n" ; }
|
| 1002 | +# }
|
943 | 1003 |
|
944 | | - print CSV "\n=== Page view totals indexed mobile ===\n\n" ;
|
945 | | - print "\n=== Page view totals indexed mobile ===\n\n" ;
|
| 1004 | +# print CSV "\n=== Page view totals indexed mobile ===\n\n" ;
|
| 1005 | +# print "\n=== Page view totals indexed mobile ===\n\n" ;
|
946 | 1006 |
|
947 | | - print CSV ",,,,,,,,,,,,,,,,,,,,,,," . $csv_recent_months ;
|
948 | | - print $csv_recent_months ;
|
| 1007 | +# print CSV ",,,,,,,,,,,,,,,,,,,,,,," . $csv_recent_months ;
|
| 1008 | +# print $csv_recent_months ;
|
949 | 1009 |
|
950 | | - # write per popular language+wiki recent months of page view totals, normalized to first month = 100
|
951 | | - # mobile
|
952 | | - $lines = 0 ;
|
953 | | - foreach $line (@totals_lastmonth)
|
954 | | - {
|
955 | | - next if $line !~ /\.m/ ;
|
956 | | - if (++$lines > $maxpopularwikis) { last ; }
|
| 1010 | +# # write per popular language+wiki recent months of page view totals, normalized to first month = 100
|
| 1011 | +# # mobile
|
| 1012 | +# $lines = 0 ;
|
| 1013 | +# foreach $line (@totals_lastmonth)
|
| 1014 | +# {
|
| 1015 | +# next if $line !~ /\.m/ ;
|
| 1016 | +# if (++$lines > $maxpopularwikis) { last ; }
|
957 | 1017 |
|
958 | | - ($project, $language) = split (',', $line) ;
|
959 | | - ($language,$mobile) = split ('\.', $language) ;
|
960 | | - $language_name = $out_languages {$language} ;
|
961 | | - if ($mobile eq 'm')
|
962 | | - { $language_name .= ' Mobile' ; }
|
| 1018 | +# ($project, $language) = split (',', $line) ;
|
| 1019 | +# ($language,$mobile) = split ('\.', $language) ;
|
| 1020 | +# $language_name = $out_languages {$language} ;
|
| 1021 | +# if ($mobile eq 'm')
|
| 1022 | +# { $language_name .= ' Mobile' ; }
|
963 | 1023 |
|
964 | | - if (($project ne "wp") && ($project ne "wx"))
|
965 | | - { print CSV ",,,,,,,,,,,,,,,,,,,,,,," . "$language_name " . &GetProjectName ($project) . "," ; }
|
966 | | - else
|
967 | | - { print CSV ",,,,,,,,,,,,,,,,,,,,,,," . "$language_name," ; }
|
| 1024 | +# if (($project ne "wp") && ($project ne "wx"))
|
| 1025 | +# { print CSV ",,,,,,,,,,,,,,,,,,,,,,," . "$language_name " . &GetProjectName ($project) . "," ; }
|
| 1026 | +# else
|
| 1027 | +# { print CSV ",,,,,,,,,,,,,,,,,,,,,,," . "$language_name," ; }
|
968 | 1028 |
|
969 | | - $m0 = &months_since_2000_01 (2010,5) ;
|
970 | | - $recent_month_0 = $totals {"month"} {$project} {"$language,${recent_months [$m0]}"} ;
|
971 | | - for ($m = $m0 ; $m < $months_recent ; $m++)
|
972 | | - {
|
973 | | - if ($recent_month_0 > 0)
|
974 | | - {
|
975 | | - print CSV sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language\.m,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
976 | | - print sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language\.m,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
977 | | - }
|
978 | | - else
|
979 | | - {
|
980 | | - print CSV "," ;
|
981 | | - print "," ;
|
982 | | - }
|
983 | | - }
|
| 1029 | +# $m0 = &months_since_2000_01 (2010,5) ;
|
| 1030 | +# $recent_month_0 = $totals {"month"} {$project} {"$language,${recent_months [$m0]}"} ;
|
| 1031 | +# for ($m = $m0 ; $m < $months_recent ; $m++)
|
| 1032 | +# {
|
| 1033 | +# if ($recent_month_0 > 0)
|
| 1034 | +# {
|
| 1035 | +# print CSV sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language\.m,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
| 1036 | +# print sprintf ("%.2f", 100 * $totals {"month"} {$project} {"$language\.m,${recent_months [$m]}"} / $recent_month_0) . "," ;
|
| 1037 | +# }
|
| 1038 | +# else
|
| 1039 | +# {
|
| 1040 | +# print CSV "," ;
|
| 1041 | +# print "," ;
|
| 1042 | +# }
|
| 1043 | +# }
|
984 | 1044 |
|
985 | | - if (($project ne "wp") && ($project ne "wx"))
|
986 | | - { print CSV "$language_name " . &GetProjectName ($project) . "\n" ; }
|
987 | | - else
|
988 | | - { print CSV "$language_name\n" ; }
|
| 1045 | +# if (($project ne "wp") && ($project ne "wx"))
|
| 1046 | +# { print CSV "$language_name " . &GetProjectName ($project) . "\n" ; }
|
| 1047 | +# else
|
| 1048 | +# { print CSV "$language_name\n" ; }
|
989 | 1049 |
|
990 | | - print "\n" ;
|
991 | | - }
|
| 1050 | +# print "\n" ;
|
| 1051 | +# }
|
992 | 1052 |
|
993 | 1053 | print CSV "\n=== Page view totals per project - non-mobile + mobile ===\n" ;
|
994 | 1054 | print "\n=== Page view totals per project - non-mobile + mobile ===\n" ;
|
995 | 1055 |
|
996 | | - print CSV "\n",,,,,,,,"$csv_recent_months" ;
|
| 1056 | + print CSV "\n,,,,,,,,$csv_recent_months" ;
|
997 | 1057 | print "\n$csv_recent_months" ;
|
998 | 1058 |
|
999 | 1059 | # write per project recent months of page view totals
|
1000 | 1060 | $lines = 0 ;
|
1001 | | - foreach $project3 (sort { $totals_project_max {"month"} {$b} <=> $totals_project_max {"month"} {$a}} keys %projects3)
|
| 1061 | + foreach $project3 (sort { $totals_project_month_combined_max {$b} <=> $totals_project_month_combined_max {$a}} keys %projects3)
|
1002 | 1062 | {
|
1003 | 1063 | print CSV ",,,,,,,," . &GetProjectName2 ($project3) . "," ;
|
1004 | 1064 | print &GetProjectName2 ($project3) . "," ;
|
1005 | 1065 |
|
1006 | 1066 | for ($m = 0 ; $m < $months_recent ; $m++)
|
1007 | 1067 | {
|
1008 | | - print CSV $totals_project {"month"} {$project3} {"${recent_months [$m]}"} . "," ;
|
1009 | | - print $totals_project {"month"} {$project3} {"${recent_months [$m]}"} . "," ;
|
| 1068 | + print CSV $totals_project_month_combined {$project3} {"${recent_months [$m]}"} . "," ;
|
| 1069 | + print $totals_project_month_combined {$project3} {"${recent_months [$m]}"} . "," ;
|
1010 | 1070 | }
|
1011 | 1071 | print CSV &GetProjectName2 ($project3) . "\n" ;
|
1012 | 1072 | print &GetProjectName2 ($project3) . "\n" ;
|
1013 | 1073 | }
|
1014 | 1074 |
|
1015 | | - print CSV "\n=== Page view totals per project indexed - non-mobile + mobile ===\n" ;
|
1016 | | - print "\n=== Page view totals per project indexed - non-mobile + mobile ===\n" ;
|
| 1075 | +# print CSV "\n=== Page view totals per project indexed - non-mobile + mobile ===\n" ;
|
| 1076 | +# print "\n=== Page view totals per project indexed - non-mobile + mobile ===\n" ;
|
1017 | 1077 |
|
1018 | | - print CSV "\n",,,,,,,,"$csv_recent_months" ;
|
1019 | | - print "\n$csv_recent_months" ;
|
| 1078 | +# print CSV "\n",,,,,,,,"$csv_recent_months" ;
|
| 1079 | +# print "\n$csv_recent_months" ;
|
1020 | 1080 |
|
1021 | | - # write per project recent months of page view totals
|
1022 | | - $lines = 0 ;
|
| 1081 | +# # write per project recent months of page view totals
|
| 1082 | +# $lines = 0 ;
|
1023 | 1083 |
|
1024 | | - foreach $project3 (sort { $totals_project_max {"month"} {$b} <=> $totals_project_max {"month"} {$a}} keys %projects3)
|
1025 | | - {
|
1026 | | - print CSV ",,,,,,,," . &GetProjectName2 ($project3) . "," ;
|
1027 | | - print &GetProjectName2 ($project3) . "," ;
|
| 1084 | +# foreach $project3 (sort { $totals_project_month_combined_max {$b} <=> $totals_project_month_combined_max {$a}} keys %projects3)
|
| 1085 | +# {
|
| 1086 | +# print CSV ",,,,,,,," . &GetProjectName2 ($project3) . "," ;
|
| 1087 | +# print &GetProjectName2 ($project3) . "," ;
|
1028 | 1088 |
|
1029 | | - $recent_month_0 = $totals_project {"month"} {$project3} {$recent_months [0]} ;
|
| 1089 | +# $recent_month_0 = $totals_project_month_combined {$project3} {$recent_months [0]} ;
|
1030 | 1090 |
|
1031 | | - for ($m = 0 ; $m < $months_recent ; $m++)
|
1032 | | - {
|
1033 | | - if ($recent_month_0 > 0)
|
1034 | | - {
|
1035 | | - print CSV sprintf ("%.2f", 100 * $totals_project {"month"} {$project3} {$recent_months [$m]} / $recent_month_0) . "," ;
|
1036 | | - print sprintf ("%.2f", 100 * $totals_project {"month"} {$project3} {$recent_months [$m]} / $recent_month_0) . "," ;
|
1037 | | - }
|
1038 | | - else
|
1039 | | - {
|
1040 | | - print CSV "," ;
|
1041 | | - print "," ;
|
1042 | | - }
|
1043 | | - }
|
| 1091 | +# for ($m = 0 ; $m < $months_recent ; $m++)
|
| 1092 | +# {
|
| 1093 | +# if ($recent_month_0 > 0)
|
| 1094 | +# {
|
| 1095 | +# print CSV sprintf ("%.2f", 100 * $totals_project_month_combined {$project3} {$recent_months [$m]} / $recent_month_0) . "," ;
|
| 1096 | +# print sprintf ("%.2f", 100 * $totals_project_month_combined {$project3} {$recent_months [$m]} / $recent_month_0) . "," ;
|
| 1097 | +# }
|
| 1098 | +# else
|
| 1099 | +# {
|
| 1100 | +# print CSV "," ;
|
| 1101 | +# print "," ;
|
| 1102 | +# }
|
| 1103 | +# }
|
1044 | 1104 |
|
1045 | | - print CSV &GetProjectName2 ($project3) . "," ;
|
1046 | | - print &GetProjectName2 ($project3) . "," ;
|
1047 | | - }
|
| 1105 | +# print CSV &GetProjectName2 ($project3) . "," ;
|
| 1106 | +# print &GetProjectName2 ($project3) . "," ;
|
| 1107 | +# }
|
1048 | 1108 |
|
1049 | | - print CSV &GetProjectName2 ($project3) . "\n" ;
|
1050 | | - print &GetProjectName2 ($project3) . "\n" ;
|
| 1109 | +# print CSV &GetProjectName2 ($project3) . "\n" ;
|
| 1110 | +# print &GetProjectName2 ($project3) . "\n" ;
|
1051 | 1111 |
|
1052 | 1112 | close CSV ;
|
1053 | 1113 |
|
Index: trunk/wikistats/dumps/WikiReportsOutputMisc.pm |
— | — | @@ -455,18 +455,22 @@ |
456 | 456 |
|
457 | 457 | $code_website = "<a href='${out_urls {$wpc}}'>$wpc3</a>" ;
|
458 | 458 |
|
459 | | -
|
460 | 459 | if ($sitemap_new_layout)
|
461 | 460 | {
|
462 | 461 | # $out_html .= &tr (&tdimg ("<a href='TablesWikipedia" . uc($wpc) . ".htm'><img src='../Tables.png'></a> " .
|
463 | 462 | # $out_language_article = "<a href='" . $out_article {$wpc} . "'><b><font size=+1 color='#0000A0' face=\'Times'>W</font></b></a>" ;
|
464 | 463 | # $out_language_article = "[<a href='" . $out_article {$wpc} . "'>?</a>]" ;
|
465 | 464 | $out_language_article = "<a href='" . $out_article {$wpc} . "'>?</a> |" ;
|
| 465 | +
|
| 466 | + $dir_all_languages = '' ;
|
| 467 | + if ($region ne '')
|
| 468 | + { $dir_all_languages = '../EN/' ; }
|
| 469 | +
|
466 | 470 | $out_html .= &tr (
|
467 | 471 | # &tdcb ($out_language_article .
|
468 | 472 | # "<a href='ChartsWikipedia" . uc($wpc) . ".htm'><img src='../BarCharts.png'></a>") .
|
469 | | - &tdcb (&w("<a href='TablesWikipedia" . uc($wpc) . ".htm'> " . $out_btn_tables . " </a>")) .
|
470 | | - &tdcb (&w("<a href='ChartsWikipedia" . uc($wpc) . ".htm'> " . $out_btn_charts . " </a>")) .
|
| 473 | + &tdcb (&w("<a href='${dir_all_languages}TablesWikipedia" . uc($wpc) . ".htm'> " . $out_btn_tables . " </a>")) .
|
| 474 | + &tdcb (&w("<a href='${dir_all_languages}ChartsWikipedia" . uc($wpc) . ".htm'> " . $out_btn_charts . " </a>")) .
|
471 | 475 | # &tdcb ("<a href='ChartsWikipedia" . uc($wpc) . ".htm'><img src='../BarCharts.png'></a>") .
|
472 | 476 | (($wikimedia && (!$mode_wx)) ? &tdcb ($code_website) : &tdlb ($code_website)) .
|
473 | 477 | # (((! $mode_wx) && (! $singlewiki)) ? ($wikimedia ? &tdlb ($out_language_name . ' ' . $out_language_article) : "") : "") .
|
— | — | @@ -511,7 +515,7 @@ |
512 | 516 | { $out_html .= "<h2>" . $out_btn_charts . "</h2>\n" ; }
|
513 | 517 | }
|
514 | 518 |
|
515 | | - $out_html .= "<a id='see_also' name='see_also'><table class='l' border=1 cellspacing=0 id=table3 style='' summary=''>\n" ;
|
| 519 | + $out_html .= "<a id='see_also' name='see_also'></a><table class='l' border=1 cellspacing=0 id=table3 style='' summary=''>\n" ;
|
516 | 520 |
|
517 | 521 | if ((! $mode_wx) && (! $singlewiki))
|
518 | 522 | {
|
— | — | @@ -1102,7 +1106,7 @@ |
1103 | 1107 |
|
1104 | 1108 | sub GenerateHtmlStartComparisonTables
|
1105 | 1109 | {
|
1106 | | - &LogT ("GenerateHtmlStartComparisonTables\n") ;
|
| 1110 | + &LogT ("\nGenerateHtmlStartComparisonTables\n") ;
|
1107 | 1111 |
|
1108 | 1112 | if ($pageviews)
|
1109 | 1113 | {
|
— | — | @@ -1138,12 +1142,15 @@ |
1139 | 1143 | if ($region ne "")
|
1140 | 1144 | { $out_html_title .= " for <font color=#008000>" . ucfirst ($region) . "</font>"; }
|
1141 | 1145 |
|
1142 | | - if ($pageviews_non_mobile)
|
1143 | | - { $out_html_title .= "<font color=#008000>, Non-mobile</font>" ; }
|
1144 | | - elsif ($pageviews_mobile)
|
1145 | | - { $out_html_title .= "<font color=#008000>, Mobile</font>" ; }
|
1146 | | - elsif ($pageviews_combined)
|
1147 | | - { $out_html_title .= "<font color=#008000>, All Platforms</font>" ; }
|
| 1146 | + if ($mode_wp)
|
| 1147 | + {
|
| 1148 | + if ($pageviews_non_mobile)
|
| 1149 | + { $out_html_title .= "<font color=#008000>, Non-mobile</font>" ; }
|
| 1150 | + elsif ($pageviews_mobile)
|
| 1151 | + { $out_html_title .= "<font color=#008000>, Mobile</font>" ; }
|
| 1152 | + elsif ($pageviews_combined)
|
| 1153 | + { $out_html_title .= "<font color=#008000>, All Platforms</font>" ; }
|
| 1154 | + }
|
1148 | 1155 |
|
1149 | 1156 | if ($normalized)
|
1150 | 1157 | { $out_html_title .= "<font color=#008000>, Normalized</font>" ; }
|
Index: trunk/wikistats/dumps/WikiReportsInput.pm |
— | — | @@ -36,7 +36,21 @@ |
37 | 37 | $normalize_days_per_month = $options {"n"} ;
|
38 | 38 | $dump_gallery = $options {"G"} ;
|
39 | 39 |
|
40 | | -# Indian languages
|
| 40 | + if ($mode eq "")
|
| 41 | + { $mode = "wp" ; }
|
| 42 | + if ($mode !~ /^(?:wb|wk|wn|wp|wq|ws|wv|wx)$/)
|
| 43 | + { abort ("Specify mode as: -m [wb|wk|wn|wp|wq|ws|wv|wx]\n(wp=wikipedia (default), wb=wikibooks, wk=wiktionary, wn=wikinews, wq=wikiquote, ws=wikisource, wv=wikiversity, wx=wikispecial)") ; }
|
| 44 | +
|
| 45 | + if ($mode eq "wb") { $mode_wb = $true ; }
|
| 46 | + if ($mode eq "wk") { $mode_wk = $true ; }
|
| 47 | + if ($mode eq "wn") { $mode_wn = $true ; }
|
| 48 | + if ($mode eq "wp") { $mode_wp = $true ; }
|
| 49 | + if ($mode eq "wq") { $mode_wq = $true ; }
|
| 50 | + if ($mode eq "ws") { $mode_ws = $true ; }
|
| 51 | + if ($mode eq "wv") { $mode_wv = $true ; }
|
| 52 | + if ($mode eq "wx") { $mode_wx = $true ; }
|
| 53 | +
|
| 54 | + # Indian languages
|
41 | 55 | # as Assamese (http://as.wikipedia.org)
|
42 | 56 | # bn Bengali (http://bn.wikipedia.org)
|
43 | 57 | # bh Bhojpuri (http://bh.wikipedia.org)
|
— | — | @@ -174,7 +188,7 @@ |
175 | 189 | $keys_html_pageviews_all_projects = 'combined,' ;
|
176 | 190 | print "Generate page views report for mobile + non-mobile site" ;
|
177 | 191 | }
|
178 | | - else { abort ("Invalid option for pageviews: specify '-v n' for non-mobile or '-v m' for mobile data") ; }
|
| 192 | + else { abort ("Invalid option for pageviews: specify '-v n' for non-mobile or '-v m' for mobile data or '-v c' for combination") ; }
|
179 | 193 |
|
180 | 194 | $pageviews = $true ;
|
181 | 195 |
|
— | — | @@ -186,23 +200,13 @@ |
187 | 201 | print "\nCollect pageviews for $keys_html_pageviews_all_projects\n\n" ;
|
188 | 202 | }
|
189 | 203 |
|
| 204 | + if ($pageviews && (! $pageviews_non_mobile) && (! $mode_wp))
|
| 205 | + { abort ("For all projects expect Wikipedia only render page views reports for 'non-mobile' aka 'normal'") ; }
|
| 206 | +
|
190 | 207 | if (defined $animation)
|
191 | 208 | { undef $pageviews ; undef $categorytrees ; }
|
192 | 209 |
|
193 | | - if ($mode eq "")
|
194 | | - { $mode = "wp" ; }
|
195 | | - if ($mode !~ /^(?:wb|wk|wn|wp|wq|ws|wv|wx)$/)
|
196 | | - { abort ("Specify mode as: -m [wb|wk|wn|wp|wq|ws|wv|wx]\n(wp=wikipedia (default), wb=wikibooks, wk=wiktionary, wn=wikinews, wq=wikiquote, ws=wikisource, wv=wikiversity, wx=wikispecial)") ; }
|
197 | 210 |
|
198 | | - if ($mode eq "wb") { $mode_wb = $true ; }
|
199 | | - if ($mode eq "wk") { $mode_wk = $true ; }
|
200 | | - if ($mode eq "wn") { $mode_wn = $true ; }
|
201 | | - if ($mode eq "wp") { $mode_wp = $true ; }
|
202 | | - if ($mode eq "wq") { $mode_wq = $true ; }
|
203 | | - if ($mode eq "ws") { $mode_ws = $true ; }
|
204 | | - if ($mode eq "wv") { $mode_wv = $true ; }
|
205 | | - if ($mode eq "wx") { $mode_wx = $true ; }
|
206 | | -
|
207 | 211 | # if (! ($dumpdate =~ m/^\d{8,8}$/))
|
208 | 212 | # { abort ("Specify SQL dump date as: -d yyyymmdd\n") ; }
|
209 | 213 | # $filedate = timegm (0,0,0,substr($dumpdate,6,2),
|