Dr. Trigon wrote:
> Hello all!
>
> "[Toolserver-l] Internally calling the MediaWiki API on Toolserver" is
> a very good idea!!
>
> What about doing the same e.g. with the actual pywikipedia bot  
> framework
> to have some API for python script as well?
>
> Greetings
> Dr. Trigon

Hi again,

I decided to drop this for now (atleast for myself, anyone else can  
ofcourse pick it[1]).
Because there were too many problems setting it up:
* Missing tables that MW wants by default (mostly cache tables)
* Invisibility of some indexes that the API needs
* Configuration problems
* more errors, problems and incompatibilities

What I did do to solve the problem I was having (which inspired me to  
bring this up)
is write the following tool:
http://toolserver.org/~krinkle/getWikiAPI.php

Which can be used to get wiki-specific information by any of the  
identifiers we know (like
database name, sitename, host, url, domain, topdomain)

Can come in handy if you got one of the pieces but are missing the  
other pieces (either
from within a tool or off-toolserver)

This API supports a few human readable formats and serliazed PHP and  
JSON/JSONP callbacks:
* http://toolserver.org/~krinkle/getWikiAPI.php?wikiids=commons#output
* 
http://toolserver.org/~krinkle/getWikiAPI.php?wikiids=media&format=json&callback=myFunction
* http://toolserver.org/~krinkle/getWikiAPI.php?wikiids=dewikt&format=php_print

--
Krinkle


[1] Some points for who would like to do this:
* svn checkout /branchces/wmf/1.16wmf4 (better wait two weeks so you  
can take /1.17wmf1)
* regularly update this from svn
* global variable aray (eg. $tsWmfApi) with wanted databasename,  
database user and datebase password
(users can pass their .my.cnf. user/password and then which ever  
database they need)
* Map this to the right dbhost (either replace _p with -p and go to  
dbname.rrdb.toolserver.org or get it from sql.toolserver.org /  
toolserver.wiki table (SELECT server WHERE  
dbname=sql_clean($tsWmfApi['dbname']). )
* include the right extension files for the right wikis (or include  
none for all wikis, but don't include all for all wikis)
** Use wgConf(), see http://noc.wikimedia.org/conf/CommonSettings.php.txt 
, http://noc.wikimedia.org/conf/InitialiseSettings.php.txt
* in LocalSettings.php set $wgLocalisationCacheConf['store'] =  
'files'; // since l10n_cache doesn't exist on Toolserver
* Figure out how to fix the missing objectcache table as well.
* Figure out how to stop mediawiki from forcing index in queries since  
those indexes are not visible from views on Toolserver
** There's a useIndexClause() function in /includes/db/ 
DatabaseMysql.php. Reset to returning ""
** Then there's a lot of calls to $this-> addOption( 'USE INDEX', / 
* ....*/ ) in api modules, add an if() statement to not use index if  
$value is USE INDEX.
* And more



_______________________________________________
Toolserver-l mailing list ([email protected])
https://lists.wikimedia.org/mailman/listinfo/toolserver-l
Posting guidelines for this list: 
https://wiki.toolserver.org/view/Mailing_list_etiquette

Reply via email to