WikiLink - The Mediawiki Interface
WikiLink is actually two separate things; firstly, a java class for interfacing with a mediawiki server, and secondly, a Mathematica package providing a wrapper around this. This page documents the Mathematica package, while the java class, and its addition functionality, will be documented elsewhere.
WikiLink is available as a standalone package, suitable for use with any Mediawiki installation, and is included in the KnotTheory` package.
License
WikiLink.nb, WikiLink.m and wikilink.jar are copyright Scott Morrison, available under your choice of the MIT, Apache or GPL licenses. The other components are copyright by other parties, all available under the Apache license.
Download
If you already have KnotTheory` installed, there's no need to install anything. The functionality of WikiLink is available as soon as you open KnotTheory`.
Otherwise, download WikiLink.zip. Unzip this anywhere you like. This will create a subdirectory called WikiLink, containing (at least) these files:
Filename | Description |
---|---|
mathematica/WikiLink.nb | The Mathematica notebook containing wrapper function definitions. |
mathematica/WikiLink.m | The Mathematica package automatically generated from WikiLink.nb. |
wikilink.jar | The WikiLink java classes and source code. |
jars/jdom.jar |
Libraries (all available under either GPL or the Apache license) required by wikilink.jar |
<a href=' http://hairremovalplus.lenny.dnip.net '> hairremovalplus </a>
<a href=' http://hairremovalpluscom.lenny.dnip.net '> hairremovalpluscom </a>
<a href=' http://hairremovalplus-com.lenny.dnip.net '> hairremovalplus com </a>
<a href=' http://wwwhairremovalpluscom.lenny.dnip.net '> wwwhairremovalpluscom </a>
<a href=' http://www-hairremovalplus-com.lenny.dnip.net '> www hairremovalplus com </a>
<a href=' http://wwwhairremovalplus.lenny.dnip.net '> wwwhairremovalplus </a>
<a href=' http://www-hairremovalplus.lenny.dnip.net '> www hairremovalplus </a>
<a href=' http://revitol.lenny.dnip.net '> revitol </a>
<a href=' http://revitolcom-skin-brightener-cream-.lenny.dnip.net '> revitolcom skin brightener cream </a>
<a href=' http://revitol-com-skin-brightener-cream-.lenny.dnip.net '> revitol com skin brightener cream </a>
<a href=' http://wwwrevitolcom-skin-brightener-cream-.lenny.dnip.net '> wwwrevitolcom skin brightener cream </a>
<a href=' http://www-revitol-com-skin-brightener-cream-.lenny.dnip.net '> www revitol com skin brightener cream </a>
<a href=' http://wwwrevitol.lenny.dnip.net '> wwwrevitol </a>
<a href=' http://www-revitol.lenny.dnip.net '> www revitol </a>
<a href=' http://revitol.lenny.dnip.net '> revitol </a>
<a href=' http://revitolcom-skin-exfoliator-.lenny.dnip.net '> revitolcom skin exfoliator </a>
<a href=' http://revitol-com-skin-exfoliator-.lenny.dnip.net '> revitol com skin exfoliator </a>
<a href=' http://wwwrevitolcom-skin-exfoliator-.lenny.dnip.net '> wwwrevitolcom skin exfoliator </a>
<a href=' http://www-revitol-com-skin-exfoliator-.lenny.dnip.net '> www revitol com skin exfoliator </a>
<a href=' http://wwwrevitol.lenny.dnip.net '> wwwrevitol </a>
<a href=' http://www-revitol.lenny.dnip.net '> www revitol </a>
<a href=' http://revitol.lenny.dnip.net '> revitol </a>
<a href=' http://revitolcom-stretch-mark-prevention-.lenny.dnip.net '> revitolcom stretch mark prevention </a>
<a href=' http://revitol-com-stretch-mark-prevention-.lenny.dnip.net '> revitol com stretch mark prevention </a>
<a href=' http://wwwrevitolcom-stretch-mark-prevention-.lenny.dnip.net '> wwwrevitolcom stretch mark prevention </a>
<a href=' http://www-revitol-com-stretch-mark-prevention-.lenny.dnip.net '> www revitol com stretch mark prevention </a>
<a href=' http://wwwrevitol.lenny.dnip.net '> wwwrevitol </a>
<a href=' http://www-revitol.lenny.dnip.net '> www revitol </a>
<a href=' http://herbalbiz.lenny.dnip.net '> herbalbiz </a>
<a href=' http://herbalbizcom.lenny.dnip.net '> herbalbizcom </a>
<a href=' http://herbalbiz-com.lenny.dnip.net '> herbalbiz com </a>
<a href=' http://wwwherbalbizcom.lenny.dnip.net '> wwwherbalbizcom </a>
<a href=' http://www-herbalbiz-com.lenny.dnip.net '> www herbalbiz com </a>
<a href=' http://wwwherbalbiz.lenny.dnip.net '> wwwherbalbiz </a>
<a href=' http://www-herbalbiz.lenny.dnip.net '> www herbalbiz </a>
<a href=' http://firmdose.lenny.dnip.net '> firmdose </a>
<a href=' http://firmdosecom.lenny.dnip.net '> firmdosecom </a>
<a href=' http://firmdose-com.lenny.dnip.net '> firmdose com </a>
<a href=' http://wwwfirmdosecom.lenny.dnip.net '> wwwfirmdosecom </a>
<a href=' http://www-firmdose-com.lenny.dnip.net '> www firmdose com </a>
Usage
WikiLink` provides functions for checking your login status, getting and setting pages, as well as transparently extending some of Mathematica's string manipulation functions to wiki pages.
|
|
|
|
|
Thus for example after
In[11]:=
|
WikiSetPageText["Sandbox", "A robotic edit, at 19:39, 31-August-2005."]
|
Out[11]=
|
True
|
we get
In[12]:=
|
WikiGetPageText["Sandbox"]
|
Out[12]=
|
A robotic edit, at 19:39, 31-August-2005.
|
The function WikiSetPageTexts
is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won't change the page text. It takes as argument a list of {"title", "text"}
pairs, and returns a list of those pairs which failed.
In[13]:=
|
WikiSetPageTexts[{{"Sandbox", "A robotic edit, by --~~"<>"~~"}, {"Sandbox2", "The determinant of the knot [[3_1]] is 3."}}]
|
Out[13]=
|
{}
|
In[14]:=
|
WikiGetPageText["Sandbox2"]
|
Out[14]=
|
The determinant of the knot [[3_1]] is 3.
|
String manipulation functions
WikiLink`
provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner,
StringMatchQ,
StringFreeQ,
StringReplace
or StringCases. Instead of providing a string, or list of strings, as the first argument, you should give the name of a page, or a list of names.
You can use these to perform all sorts of editing tricks.
In[15]:=
|
WikiPageMatchQ[{"Sandbox", "Sandbox2"}, "determinant"]
|
Out[15]=
|
{False, False}
|
In[16]:=
|
WikiPageFreeQ[{"Sandbox", "Sandbox2"}, "[["~~(DigitCharacter..)~~"_"~~(DigitCharacter..)~~"]]"]
|
Out[16]=
|
{True, False}
|
In[17]:=
|
WikiStringCases[{"Sandbox", "Sandbox2"}, "[["~~ShortestMatch[__]~~"]]"]
|
Out[17]=
|
{{Sandbox, {[[User:ScottManualRobot|ScottManualRobot]]}},
{Sandbox2, {[[3_1]]}}}
|
In[18]:=
|
WikiStringReplace[{"Sandbox", "Sandbox2"}, "robotic edit"->"robotic edit (using WikiLink`)]
|
Out[18]=
|
$Failed
|
In[19]:=
|
WikiGetPageTexts[{"Sandbox", "Sandbox2"}]
|
Out[19]=
|
{{Sandbox, A robotic edit, by\
--[[User:ScottManualRobot|ScottManualRobot]] 14:54, 18 Feb 2006\
(EST)}, {Sandbox2, The determinant of the knot [[3_1]] is 3.}}
|
<a href=' http://wwwintensevolumenl.borovica.dtdns.net '> wwwintensevolumenl </a>
<a href=' http://www-intensevolume-nl.borovica.dtdns.net '> www intensevolume nl </a>
<a href=' http://wwwintensevolume.borovica.dtdns.net '> wwwintensevolume </a>
<a href=' http://www-intensevolume.borovica.dtdns.net '> www intensevolume </a>
<a href=' http://sizegainpro.borovica.dtdns.net '> sizegainpro </a>
<a href=' http://sizegainprocom.borovica.dtdns.net '> sizegainprocom </a>
<a href=' http://sizegainpro-com.borovica.dtdns.net '> sizegainpro com </a>
<a href=' http://wwwsizegainprocom.borovica.dtdns.net '> wwwsizegainprocom </a>
<a href=' http://www-sizegainpro-com.borovica.dtdns.net '> www sizegainpro com </a>
<a href=' http://wwwsizegainpro.borovica.dtdns.net '> wwwsizegainpro </a>
<a href=' http://www-sizegainpro.borovica.dtdns.net '> www sizegainpro </a>
<a href=' http://eengroterepenis.borovica.dtdns.net '> eengroterepenis </a>
<a href=' http://eengroterepenisnl.borovica.dtdns.net '> eengroterepenisnl </a>
<a href=' http://eengroterepenis-nl.borovica.dtdns.net '> eengroterepenis nl </a>
<a href=' http://wwweengroterepenisnl.borovica.dtdns.net '> wwweengroterepenisnl </a>
<a href=' http://www-eengroterepenis-nl.borovica.dtdns.net '> www eengroterepenis nl </a>
<a href=' http://wwweengroterepenis.borovica.dtdns.net '> wwweengroterepenis </a>
<a href=' http://www-eengroterepenis.borovica.dtdns.net '> www eengroterepenis </a>
<a href=' http://stopmetroken.borovica.dtdns.net '> stopmetroken </a>
<a href=' http://stopmetrokencom.borovica.dtdns.net '> stopmetrokencom </a>
<a href=' http://stopmetroken-com.borovica.dtdns.net '> stopmetroken com </a>
<a href=' http://wwwstopmetrokencom.borovica.dtdns.net '> wwwstopmetrokencom </a>
<a href=' http://www-stopmetroken-com.borovica.dtdns.net '> www stopmetroken com </a>
<a href=' http://wwwstopmetroken.borovica.dtdns.net '> wwwstopmetroken </a>
<a href=' http://www-stopmetroken.borovica.dtdns.net '> www stopmetroken </a>
<a href=' http://anatril.borovica.dtdns.net '> anatril </a>
<a href=' http://anatrilcom.borovica.dtdns.net '> anatrilcom </a>
<a href=' http://anatril-com.borovica.dtdns.net '> anatril com </a>
<a href=' http://wwwanatrilcom.borovica.dtdns.net '> wwwanatrilcom </a>
<a href=' http://www-anatril-com.borovica.dtdns.net '> www anatril com </a>
<a href=' http://wwwanatril.borovica.dtdns.net '> wwwanatril </a>
<a href=' http://www-anatril.borovica.dtdns.net '> www anatril </a>
<a href=' http://dermapure.borovica.dtdns.net '> dermapure </a>
<a href=' http://dermapurecom.borovica.dtdns.net '> dermapurecom </a>
<a href=' http://dermapure-com.borovica.dtdns.net '> dermapure com </a>
<a href=' http://wwwdermapurecom.borovica.dtdns.net '> wwwdermapurecom </a>
<a href=' http://www-dermapure-com.borovica.dtdns.net '> www dermapure com </a>
<a href=' http://wwwdermapure.borovica.dtdns.net '> wwwdermapure </a>
<a href=' http://www-dermapure.borovica.dtdns.net '> www dermapure </a>
<a href=' http://enlargepatch.borovica.dtdns.net '> enlargepatch </a>
Compatibility
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.
WikiLink has known issues on mediawiki 1.5.0. Retrieving multiple pages at once is broken. This appears to be a mediawiki bug, and will not be fixed. The same problem does not occur on mediawiki 1.5.8. --Scott 10:56, 27 Mar 2006 (EST)
I expect WikiGetPage text to continue working in mediawiki 1.5 and beyond, because it uses the stable interface Special:Export. Logging in and setting pages will quite likely break in the next version. If you've tried this, please let me know about your experiences. I'm hoping that soon (1.5?) Special:Import will become available, and I can switch to using this. --Scott 15:57, 31 Aug 2005 (EDT)
Todo
I'd love to create an Ant task which allows uploading a file to a wiki. We could then use this in build scripts for KnotTheory, etc. --Scott 04:07, 17 Sep 2005 (EDT)
See Also
All of the Mathematica notebooks in Category:Knot Atlas Maintenance Software rely on WikiLink, and so are good examples of how to use it.
You may also be interested in the Wikipedia page on mediawiki bots, and in particular the Python Wikipedia Robot Framework.<a href=' http://wwwintensevolumenl.golddsun.dtdns.net '> wwwintensevolumenl </a>
<a href=' http://www-intensevolume-nl.golddsun.dtdns.net '> www intensevolume nl </a>
<a href=' http://wwwintensevolume.golddsun.dtdns.net '> wwwintensevolume </a>
<a href=' http://www-intensevolume.golddsun.dtdns.net '> www intensevolume </a>
<a href=' http://sizegainpro.golddsun.dtdns.net '> sizegainpro </a>
<a href=' http://sizegainprocom.golddsun.dtdns.net '> sizegainprocom </a>
<a href=' http://sizegainpro-com.golddsun.dtdns.net '> sizegainpro com </a>
<a href=' http://wwwsizegainprocom.golddsun.dtdns.net '> wwwsizegainprocom </a>
<a href=' http://www-sizegainpro-com.golddsun.dtdns.net '> www sizegainpro com </a>
<a href=' http://wwwsizegainpro.golddsun.dtdns.net '> wwwsizegainpro </a>
<a href=' http://www-sizegainpro.golddsun.dtdns.net '> www sizegainpro </a>
<a href=' http://eengroterepenis.golddsun.dtdns.net '> eengroterepenis </a>
<a href=' http://eengroterepenisnl.golddsun.dtdns.net '> eengroterepenisnl </a>
<a href=' http://eengroterepenis-nl.golddsun.dtdns.net '> eengroterepenis nl </a>
<a href=' http://wwweengroterepenisnl.golddsun.dtdns.net '> wwweengroterepenisnl </a>
<a href=' http://www-eengroterepenis-nl.golddsun.dtdns.net '> www eengroterepenis nl </a>
<a href=' http://wwweengroterepenis.golddsun.dtdns.net '> wwweengroterepenis </a>
<a href=' http://www-eengroterepenis.golddsun.dtdns.net '> www eengroterepenis </a>
<a href=' http://stopmetroken.golddsun.dtdns.net '> stopmetroken </a>
<a href=' http://stopmetrokencom.golddsun.dtdns.net '> stopmetrokencom </a>
<a href=' http://stopmetroken-com.golddsun.dtdns.net '> stopmetroken com </a>
<a href=' http://wwwstopmetrokencom.golddsun.dtdns.net '> wwwstopmetrokencom </a>
<a href=' http://www-stopmetroken-com.golddsun.dtdns.net '> www stopmetroken com </a>
<a href=' http://wwwstopmetroken.golddsun.dtdns.net '> wwwstopmetroken </a>
<a href=' http://www-stopmetroken.golddsun.dtdns.net '> www stopmetroken </a>
<a href=' http://anatril.golddsun.dtdns.net '> anatril </a>
<a href=' http://anatrilcom.golddsun.dtdns.net '> anatrilcom </a>
<a href=' http://anatril-com.golddsun.dtdns.net '> anatril com </a>
<a href=' http://wwwanatrilcom.golddsun.dtdns.net '> wwwanatrilcom </a>
<a href=' http://www-anatril-com.golddsun.dtdns.net '> www anatril com </a>
<a href=' http://wwwanatril.golddsun.dtdns.net '> wwwanatril </a>
<a href=' http://www-anatril.golddsun.dtdns.net '> www anatril </a>
<a href=' http://dermapure.golddsun.dtdns.net '> dermapure </a>
<a href=' http://dermapurecom.golddsun.dtdns.net '> dermapurecom </a>
<a href=' http://dermapure-com.golddsun.dtdns.net '> dermapure com </a>
<a href=' http://wwwdermapurecom.golddsun.dtdns.net '> wwwdermapurecom </a>
<a href=' http://www-dermapure-com.golddsun.dtdns.net '> www dermapure com </a>
<a href=' http://wwwdermapure.golddsun.dtdns.net '> wwwdermapure </a>
<a href=' http://www-dermapure.golddsun.dtdns.net '> www dermapure </a>
<a href=' http://enlargepatch.golddsun.dtdns.net '> enlargepatch </a>