Changes

Jump to navigation Jump to search
3,161 bytes added ,  11:51, 16 June 2015
no edit summary
Find out "What's that Wiki Running?" at https://freephile.org/wikireport
== README ==
 
Using the MediaWiki API, we want to query a wiki installation about the
site's metadata that tells us the version, and the extensions running there.
 
We want to be able to retrieve this data, and then import it into our CiviCRM database
We also want to be able to create a nice public-facing reporting tool that we
can use to do one-off reports, or to show to site owners.
 
So we'll develop it in 3 phases:
<ol>
<li> The public-facing reporting tool will be developed first
<li> The conduit to read and write data to the CiviCRM system
<li> Publicize the reporting tool <br />
<ol>
<li>through campaigns to the people we have in the database
<li>through social and other networks
<li>possibly as a case study or info example on how to make APIs work for you and talk to each other.
</ol>
<ol>
The goal of publicizing the reporting tool is to make it an inbound marketing tool
If we can collect information about wikis that we don't know about, then we can market to those people.
 
 
To create the UI, we'll use Bootstrap
* see https://en.wikipedia.org/wiki/Bootstrap_%28front-end_framework%29
* see http://getbootstrap.com/getting-started/#examples
* see https://freephile.org/wiki/Bootstrap
 
For some wikis, we may need to determine the api URL when we only have the "wiki" URL.
Using the common setup where the code is hosted at w/ and the pretty URLs are at wiki/, we
find this in the source of the Main_Page:
<nowiki><link rel="EditURI" type="application/rsd+xml" href="https://freephile.org/w/api.php?action=rsd" /></nowiki>
 
The MediaWiki API supports many formats, with json and jsonfm the most useful. json is what you think it is,
and jsonfm is formatted for viewing in the browser (good for development only)
 
The API has many possible parameters. https://www.mediawiki.org/wiki/API:Siteinfo
The default is 'general', and you should combine as many as you want. So, to get
all the info that we're after, we would compose a query like so:
<nowiki>https://freephile.org/w/api.php?action=query&meta=siteinfo&format=jsonfm&siprop=general|extensions|statistics</nowiki>
 
== General Info ==
From 'General' we're interested in
* "base" (which we already have? chicken/egg)
* "sitename"
* "logo"
* "generator"
* "phpversion"
* "phpsapi"
* "dbtype"
* "dbversion"
* "lang" --just in case it's not 'en'
* "timezone"
* "time"
* "favicon"
 
I've found that there can be empty values; and which ones are empty depend on the instance, so we won't
hard-code what is in the report... we'll just report on what we find. Likewise, we'll endeavor to collect all the info
that is useful, but there will be information that is unavailable in some cases.
 
== Exensions ==
After the general info, we are especially interested in
extensions. Again, the info available for any given extension is going to vary, so we'll report on what's available,
and likewise we will record what we can find.
Do we timestamp in the CiviCRM database? The "profile" will change over time, and so do we care about what it used to be?
== Background ==
[https://labs.mbrooks.info/demos/Tidy-Table/ Tidy Table] is a jQuery plugin that creates HTML tables from the data that you feed into the client as JSON The only interesting thing here is the fact that I might want to have something akin to their demo for the initial form state: Allow the user to quickly/easily select which parts of the MW API they want to report on.
== Code ==
You can clone, fork, and send pull requests at github https://github.com/freephile/wikireport
{{References}}
4,558

edits

Navigation menu