Wikistats/archive: Difference between revisions
Revision as of 17:08, 2 March 2006
Wikistats is a set of Perl scripts used to generate detailed statistics for Wikimedia projects. These statistics are available at stats.wikimedia.org. Erik Zachte is the author of the scripts, and he is also responsible for running them and posting the results. All statistics are produced by analyzing the database dumps, which are usually created monthly.
See Wikistats csv for information on accessing statistics in comma-separated values (CSV) format.
Source code
The scripts can be found here: http://stats.wikimedia.org/scripts.zip
Running Wikistats on your own MediaWiki site
The scripts have not yet been packaged for general consumption, but they can be made to work on any MediaWiki site without too much trouble.
You will need:
- Perl version 5.6 or later
- Ploticus
- MediaWiki 1.5 or later (for the
dumpBackup.php
script)
Here are the (admittedly hacky) steps to generate the statistics. This is known to work on FreeBSD at least.
- Create a new directory and unzip the scripts there
- Note that the script files are in DOS text format. If you are on Unix, you should convert them to Unix format.
- You might also need to make
WikiCounts.pl
andWikiReports.pl
executable.
- Obtain a full XML dump of your MediaWiki data using the
dumpBackup.php
script as described at MediaWiki#Database_dump - In the directory with the scripts, create these subdirectories:
counts
dumps
dumps/en
reports
- Use bzip2 to compress the file containing the XML dump, and write the compressed output to:
dumps/en/pages_full.xml.bz2
- Run this command, where
YYYYMMDD
is the date the XML dump was taken:WikiCounts.pl -x -i dumps -o counts -l en -d YYYYMMDD
- This should create a bunch of CSV files in
counts
- This should create a bunch of CSV files in
- The
WikiReportsOutputPlots.pl
script is hardcoded to runpl
to invoke Ploticus. On some systems (like Unix) the Ploticus executable is namedploticus
. If that's the case on your system, edit the script, and change the single occurrence of"pl -"
to"ploticus -"
- Run this command, using the same
YYYYMMDD
as above:WikiReports.pl -x -i counts -o reports -l en -d YYYYMMDD
- This should create a bunch of HTML, PNG, and SVG files in
reports/EN
- This should create a bunch of HTML, PNG, and SVG files in
- In the
reports
directory, download these additional files which are referred to by the HTML in thereports/EN
directory using a relative../
path:- http://stats.wikimedia.org/background1.gif
- http://stats.wikimedia.org/black.gif
- http://stats.wikimedia.org/blanco.gif
- http://stats.wikimedia.org/bluebar.gif
- http://stats.wikimedia.org/greenbar.gif
- http://stats.wikimedia.org/grey.gif
- http://stats.wikimedia.org/redbar.gif
- http://stats.wikimedia.org/yellowbar.gif
- http://stats.wikimedia.org/WikipediaStatistics11.js
- Now you should be able to load
reports/EN/index.html
in a web browser and see the statistics.