Index: trunk/wikistats/progress/WikimediaDownload.pl |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | $url_matrix = "http://www.mediawiki.org/wiki/Special:SiteMatrix" ; |
21 | 21 | |
22 | 22 | $file_matrix = "site_matrix.html" ; |
23 | | - $file_test_input = "backup-index.html" ; |
| 23 | + $file_test_input = "Test.html" ; |
24 | 24 | $file_htm = "WikimediaDownload.htm" ; |
25 | 25 | $file_csv_lastrun = "WikimediaDumpsLastRun.csv" ; |
26 | 26 | $file_csv_lastsuccess = "WikimediaDumpsLastSuccess.csv" ; |
— | — | @@ -235,8 +235,12 @@ |
236 | 236 | else |
237 | 237 | { $date = "?" ; } |
238 | 238 | |
239 | | - ($project = $href) =~ s/([^\/]+)\/.*$/$1/ ; |
| 239 | + if ($test) |
| 240 | + { ($project = $href) =~ s/http:\/\/download.wikimedia.org\/([^\/]+)\/.*$/$1/ ; } |
| 241 | + else |
| 242 | + { ($project = $href) =~ s/([^\/]+)\/.*$/$1/ ; } |
240 | 243 | } |
| 244 | + next if $project =~ /labs/ ; |
241 | 245 | |
242 | 246 | $projectcount++ ; |
243 | 247 | &Log ("\n=== $projectcount: Project $project ===\n\n") ; |
— | — | @@ -529,7 +533,6 @@ |
530 | 534 | } |
531 | 535 | |
532 | 536 | ($date,$project,$href,$usable_dumps) = split (',', $projectinfo_lastsuccess) ; |
533 | | - |
534 | 537 | if ($project =~ /^(?:tlh|strategyapp)/) # obsolete info, project abandoned |
535 | 538 | { next ; } |
536 | 539 | |
Index: trunk/wikistats/progress/WikiCountsJobProgress.pl |
— | — | @@ -328,7 +328,7 @@ |
329 | 329 | {
|
330 | 330 | if (! -d $file)
|
331 | 331 | { next ; }
|
332 | | - if ($file !~ /^[A-Z]+$/)
|
| 332 | + if ($file !~ /^[A-Z]+(?:_[A-Z][a-z]+)?$/)
|
333 | 333 | { next ; }
|
334 | 334 | push @languages, $file ;
|
335 | 335 | }
|
— | — | @@ -338,6 +338,7 @@ |
339 | 339 |
|
340 | 340 | $reports {$project} = "<p><b>$project2</b> <small>[count]</small> " ;
|
341 | 341 | $reports_cnt = 0 ;
|
| 342 | +
|
342 | 343 | foreach $language (sort @languages)
|
343 | 344 | {
|
344 | 345 | $language_lc = lc ($language) ;
|
— | — | @@ -349,6 +350,12 @@ |
350 | 351 | $file_date = time - $file_age_secs ;
|
351 | 352 | # if ($language eq "EN")
|
352 | 353 | # {
|
| 354 | + $project_folder = $project ;
|
| 355 | + if ($project_folder =~ /Wikipedia/i)
|
| 356 | + { $project_folder = '' ; }
|
| 357 | +
|
| 358 | + $language_uc = uc $language ;
|
| 359 | +
|
353 | 360 | if ($project eq "")
|
354 | 361 | { $project = "wikipedia" ; }
|
355 | 362 |
|
— | — | @@ -356,12 +363,33 @@ |
357 | 364 |
|
358 | 365 | $file_ago = $file_age_days ;
|
359 | 366 | if ($file_ago == 0)
|
360 | | - { $file_ago = " <u>0 days, $file_age_min min</u>" ; }
|
| 367 | + # { $file_ago = " <u>0 days, $file_age_min min</u>" ; }
|
| 368 | + { $file_ago = " <u>$file_age_min min</u>" ; }
|
361 | 369 |
|
362 | 370 | $color = "green" ;
|
| 371 | + if ($language =~ /_/) # regional report
|
| 372 | + {
|
| 373 | + $language_lc = "<i>$language_lc</i>" ; # color = "#004000" ;
|
| 374 | + ($region = $language) =~ s/^[^_]+_// ; # en_india -> EN_India
|
| 375 | + $language_uc = "EN_" . ucfirst $region ;
|
| 376 | + }
|
| 377 | +
|
363 | 378 | if ($file_ago > 30)
|
364 | 379 | { $color = "darkred" ; }
|
365 | | - $reports {$project} .= "<small><font color=$color>$language_lc<sup>$file_ago</sup></font></small>, " ;
|
| 380 | +
|
| 381 | + if ($language_lc eq 'en') # make English report more prominent, this one is more often refreshed
|
| 382 | + { $language_lc = "<b>[[en]]</b>" ; }
|
| 383 | +
|
| 384 | + $reports {$project} .= "<a href='http://stats.wikimedia.org/$project_folder/$language_uc/Sitemap.htm'><small><font color=$color>$language_lc<sup>$file_ago</sup></font></small></a>, " ;
|
| 385 | +
|
| 386 | + if ($language_lc =~ /\[\[en\]\]/) # make English report more prominent, this one is more often refreshed
|
| 387 | + { $reports_english {$project} = "<a href='http://stats.wikimedia.org/$project_folder/$language_uc/Sitemap.htm'><small><font color=$color>$project<sup>$file_ago</sup></font></small></a>" }
|
| 388 | +
|
| 389 | + # if ($project !~ /_/)
|
| 390 | + # { $reports {$project} .= "<small><font color=$color>$language_lc<sup>$file_ago</sup></font></small>, " ; }
|
| 391 | + # else
|
| 392 | + # { $reports {"$project regional"} .= "<small><font color=$color>$language_lc<sup>$file_ago</sup></font></small>, " ; }
|
| 393 | +
|
366 | 394 | $reports_cnt ++ ;
|
367 | 395 |
|
368 | 396 | if ($language eq "EN")
|
— | — | @@ -433,12 +461,13 @@ |
434 | 462 | "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n" .
|
435 | 463 | "<meta http-equiv=\"refresh\" content=\"60\">\n" .
|
436 | 464 | "<title>WikiStats data gathering progress</title>\n" .
|
437 | | - # "<style type=\text/css\">\n" .
|
438 | | - # "li { background-color: #f4f4f4; list-style-type: none; }\n" .
|
439 | | - # "li li { background-color: white; }\n" .
|
440 | | - # "li ul { margin-top: 4px; margin-bottom: 8px; text-color: #900000}\n" .
|
441 | | - # "</style>\n" .
|
442 | | - "<body bgcolor=#CCCCCC>\n" ;
|
| 465 | + "<style type=\text/css\">\n" .
|
| 466 | + "a:link { color:blue;text-decoration:none;}\n" .
|
| 467 | + "a:visited {color:#0000FF;text-decoration:none;}\n" .
|
| 468 | + "a:active {color:#0000FF;text-decoration:none;}\n" .
|
| 469 | + "a:hover {color:#FF00FF;text-decoration:underline}\n" .
|
| 470 | + "</style>\n" .
|
| 471 | + "</head>\n<body bgcolor=#CCCCCC>\n" ;
|
443 | 472 |
|
444 | 473 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=gmtime(time);
|
445 | 474 | $now_gm = sprintf ("%02d-%02d-%04d %02d:%02d\n",$mday,$mon+1,$year+1900,$hour,$min) ;
|
— | — | @@ -530,14 +559,13 @@ |
531 | 560 | {
|
532 | 561 | print HTML "<a name='reports' id='reports'></a>" .
|
533 | 562 | "<hr><b>Reports generated</b>\n" .
|
534 | | - "<small>This section shows -per project per target language- the file age of index.html in days (for age < 24 hours in minutes). " .
|
| 563 | + "<small>This section shows -per project per target language- the <b>file age of index.html in days</b> (for age < 24 hours in minutes). " .
|
535 | 564 | "Note that a very recently generated report does not always contain counts up to the previous month. " .
|
536 | 565 | "See above for how up to data counts are per project language. " .
|
537 | 566 | "Color green here means: reports have been generated and published less than 30 days ago.</small>" ;
|
538 | 567 |
|
539 | | -
|
540 | | - foreach $report (sort {$report_dates {$b} <=> $report_dates {$a}} keys %report_dates)
|
541 | | - { print HTML $reports {$report} . "\n" ; }
|
| 568 | + foreach $project (sort {$report_dates {$b} <=> $report_dates {$a}} keys %report_dates)
|
| 569 | + { print HTML $reports {$project} . "\n" ; }
|
542 | 570 | }
|
543 | 571 |
|
544 | 572 | print HTML "<hr><p><b>Longest jobs</b> <small>\n" ;
|
— | — | @@ -653,6 +681,10 @@ |
654 | 682 | "td.cb {text-align:center; border: inset 1px #FFFFFF}\n" .
|
655 | 683 | "td.lb {text-align:left; border: inset 1px #FFFFFF}\n" .
|
656 | 684 | "td.rb {text-align:right; border: inset 1px #FFFFFF}\n" .
|
| 685 | + "a:link { color:blue;text-decoration:none;}\n" .
|
| 686 | + "a:visited {color:#0000FF;text-decoration:none;}\n" .
|
| 687 | + "a:active {color:#0000FF;text-decoration:none;}\n" .
|
| 688 | + "a:hover {color:#FF00FF;text-decoration:underline}\n" .
|
657 | 689 | "-->\n" .
|
658 | 690 | "</style>\n" .
|
659 | 691 |
|
— | — | @@ -757,15 +789,21 @@ |
758 | 790 |
|
759 | 791 | if ($reports_total > 0)
|
760 | 792 | {
|
| 793 | + foreach $project (sort {$report_dates {$b} <=> $report_dates {$a}} keys %report_dates)
|
| 794 | + { $reports_english .= $reports_english {$project} . ", "; }
|
| 795 | + $reports_english =~ s/, $// ;
|
| 796 | +
|
761 | 797 | print HTML "<a name='reports' id='reports'></a>\n" .
|
762 | 798 | "<hr><p><h3>Progress per project, reporting</h3>" .
|
763 | | - "<small>This section shows -per project per target language- the file age of index.html in days (for age < 24 hours in minutes). " .
|
| 799 | + "<small>This section shows -per project per target language- the <b>file age of index.html in days</b> (for age < 24 hours in minutes). " .
|
764 | 800 | "Note that a very recently generated report does not always contain counts up to the previous month. " .
|
765 | 801 | "See above for how up to data counts are per project language. " .
|
766 | | - "Color green here means: reports have been generated and published less than 30 days ago.</small>" ;
|
| 802 | + "Color green here means: reports have been generated and published less than 30 days ago. English reports are generated more often (performance issue), and therefore also listed separately.</small><p>" .
|
| 803 | + "<b>English reports</b>: $reports_english<p>" ;
|
767 | 804 |
|
768 | | - foreach $report (sort {$report_dates {$b} <=> $report_dates {$a}} keys %report_dates)
|
769 | | - { print HTML $reports {$report} . "\n" ; }
|
| 805 | +
|
| 806 | + foreach $project (sort {$report_dates {$b} <=> $report_dates {$a}} keys %report_dates)
|
| 807 | + { print HTML $reports {$project} . "\n" ; }
|
770 | 808 | }
|
771 | 809 |
|
772 | 810 | print HTML "<hr>" ;
|