[Intentional Top Post]
Here is example output from the code I've hacked together.
For some stats, I was able to use the XML API.php + SimpleXML:
$General_Stats_Suffix="api.php?format=xml&action=query&meta=siteinfo&siprop=statistics";
$today_pagecount=$doc->query->statistics['pages'];
For other things, I had to form custom queries and count() output array
sizes:
$Count_Categories_Suffix="api.php?format=xml&action=query&list=allpages&apnamespace=14";
$Count_Template_Suffix="api.php?format=xml&action=query&list=allpages&apnamespace=10";
$today_categorycount=count($doc->query->allpages->p);
Some housekeeping pages provide nice simple RSS/ATOM XML feeds you can
parse (New Pages, Recent Changes):
$doc = simplexml_load_file("$WIKIPrefixURI" .
"index.php/Special:Newpages?feed=rss&limit=20");
For other housekeeping pages that don't provide this, you have to scrape
HTML data structures using stupidity like:
$doc = simplexml_load_file($WIKI .
'index.php?title=Special:Wantedpages&limit=500&offset=0');
foreach ($doc->body->div->div->div->div->div[2]->ol->li as
$listItem) {
print " o " . $listItem->a . "\n";
}
If anyone wants to jointly develop a more-mature version, let me know.
Thanks,
~BAS
------------- Example Output -----------------------
Starting: : wiki_periodic_report.php 278 2008-02-07 19:32:42Z seklecki $
- Content Summary
o Total Page Count: 344 (344)
o Unique Articles: 122 (122)
o Images/Media Objects: 140 (140)
o Templates: 9 (9)
o Category: 10 (10)
- Activity Summary
o Total Edits: 4874 (4874)
o Total Views: 11149 (11149)
- User Summary
o Total Admins: 3 (3)
o Total Users: 19 (19)
-- New Pages (20) --
o first page
o second page
o ....
-- Most Recent Changes (Not Yet Implemented) --
-- Begin Housekeeping Items --
-- Orphaned/Lonely Pages --
o Sex
o Drugs
o Unix...
-- Dead - End Pages --
o Windows users
o Windows admins
o ....
-- Uncategorized Pages --
o Prison Sex
o PHP + SimpleXML + XHTML
-- Wanted Pages --
o SOAP-XML
o SOAP-XML
o SOAP-XML
o SOAP-XML
o SOAP-XML
o SOAP-XML
o SOAP-XML
o ....
-- Wanted Categories --
o Systems Operations
o C0ff33
o ....
On Tue, 2008-02-05 at 17:05 -0500, Brian A. Seklecki wrote:
All:
Has anyone implemented any usage reporting systems? Daily/weekly/
monthly periodic analysis?
- Something to track daily page creations / changes counts.
- List new users
- Maybe also fetch and deliver excerpts from housekeeping special:pages
like:
Special:Recentchanges
Special:Newpages
Special:Lonelypages - Pages with no link to them, orpaned
Special:Deadendpages - Pages that have no external links
Special:Uncategorizedpages - Pages lacking a category
Special:Wantedpages
Special:BrokenRedirects
Special:Wantedcategories
Dead End Pages ...
A lot of this could be gleaned from the xml.php API system -- a small PHP script using
xml_*()
functions could parse it out into human readable pages.
Thoughts?
Thanks,
--
Brian A. Seklecki <bseklecki(a)collaborativefusion.com>
Collaborative Fusion, Inc.
IMPORTANT: This message contains confidential information and is intended only for the
individual named. If the reader of this message is not an intended recipient (or the
individual responsible for the delivery of this message to an intended recipient), please
be advised that any re-use, dissemination, distribution or copying of this message is
prohibited. Please notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.