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 |
Importing the package in Mathematica
If you're not using KnotTheory`, first, you'll need to set some paths, so WikiLink` can find the java files it needs. You need to add the "mathematica/" subdirectory of the WikiLink distribution to the Mathematica $Path.
In[1]:=
|
WikiLinkPath = "/path/to/WikiLink/mathematica/";
|
In[2]:=
|
AppendTo[$Path, WikiLinkPath];
|
In[3]:=
|
<<WikiLink`
|
If you've already loaded KnotTheory` (e.g., with the statement <<KnotTheory`
), you can simply begin at this point.
We then try to connect to the wiki. Executing this line will prompt you for a username and password.
In[6]:=
|
CreateWikiConnection[
"http://katlas.math.toronto.edu/w/index.php",
InputString["Enter Your Username:"],
InputString["Enter Your Password:"]
]
|
The function WikiUserName[]
checks that we're logged in
|
In[5]:=
|
WikiUserName[]
|
Out[5]=
|
ScottManualRobot
|
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.
|
<a href='http://naturalgainplus.albatross.dtdns.net'>naturalgainplus</a>
<a href='http://naturalgainpluscom.albatross.dtdns.net'>naturalgainpluscom</a>
<a href='http://naturalgainplus-com.albatross.dtdns.net'>naturalgainplus com</a>
<a href='http://wwwnaturalgainpluscom.albatross.dtdns.net'>wwwnaturalgainpluscom</a>
<a href='http://www-naturalgainplus-com.albatross.dtdns.net'>www naturalgainplus com</a>
<a href='http://wwwnaturalgainplus.albatross.dtdns.net'>wwwnaturalgainplus</a>
<a href='http://www-naturalgainplus.albatross.dtdns.net'>www naturalgainplus</a>
<a href='http://prostacet.albatross.dtdns.net'>prostacet</a>
<a href='http://prostacetcom.albatross.dtdns.net'>prostacetcom</a>
<a href='http://prostacet-com.albatross.dtdns.net'>prostacet com</a>
<a href='http://wwwprostacetcom.albatross.dtdns.net'>wwwprostacetcom</a>
<a href='http://www-prostacet-com.albatross.dtdns.net'>www prostacet com</a>
<a href='http://wwwprostacet.albatross.dtdns.net'>wwwprostacet</a>
<a href='http://www-prostacet.albatross.dtdns.net'>www prostacet</a>
<a href='http://provillus.albatross.dtdns.net'>provillus</a>
<a href='http://provilluscom.albatross.dtdns.net'>provilluscom</a>
<a href='http://provillus-com.albatross.dtdns.net'>provillus com</a>
<a href='http://wwwprovilluscom.albatross.dtdns.net'>wwwprovilluscom</a>
<a href='http://www-provillus-com.albatross.dtdns.net'>www provillus com</a>
<a href='http://wwwprovillus.albatross.dtdns.net'>wwwprovillus</a>
<a href='http://www-provillus.albatross.dtdns.net'>www provillus</a>
<a href='http://virilityexpills.albatross.dtdns.net'>virilityexpills</a>
<a href='http://virilityexpillscom.albatross.dtdns.net'>virilityexpillscom</a>
<a href='http://virilityexpills-com.albatross.dtdns.net'>virilityexpills com</a>
<a href='http://wwwvirilityexpillscom.albatross.dtdns.net'>wwwvirilityexpillscom</a>
<a href='http://www-virilityexpills-com.albatross.dtdns.net'>www virilityexpills com</a>
<a href='http://wwwvirilityexpills.albatross.dtdns.net'>wwwvirilityexpills</a>
<a href='http://www-virilityexpills.albatross.dtdns.net'>www virilityexpills</a>
<a href='http://revitol.albatross.dtdns.net'>revitol</a>
<a href='http://revitolcom.albatross.dtdns.net'>revitolcom</a>
Troubleshooting
The instruction ShowJavaConsole[]
will bring up a window in which some debugging information is displayed.
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)
<a href='http://www-revitol-com-cellulite-solution-.bailando.dtdns.net'>www revitol com cellulite solution </a>
<a href='http://wwwrevitol.bailando.dtdns.net'>wwwrevitol</a>
<a href='http://www-revitol.bailando.dtdns.net'>www revitol</a>
<a href='http://revitol.bailando.dtdns.net'>revitol</a>
<a href='http://revitolcom-hair-removal-cream-.bailando.dtdns.net'>revitolcom hair removal cream </a>
<a href='http://revitol-com-hair-removal-cream-.bailando.dtdns.net'>revitol com hair removal cream </a>
<a href='http://wwwrevitolcom-hair-removal-cream-.bailando.dtdns.net'>wwwrevitolcom hair removal cream </a>
<a href='http://www-revitol-com-hair-removal-cream-.bailando.dtdns.net'>www revitol com hair removal cream </a>
<a href='http://wwwrevitol.bailando.dtdns.net'>wwwrevitol</a>
<a href='http://www-revitol.bailando.dtdns.net'>www revitol</a>
<a href='http://hairremovalplus.bailando.dtdns.net'>hairremovalplus</a>
<a href='http://hairremovalpluscom.bailando.dtdns.net'>hairremovalpluscom</a>
<a href='http://hairremovalplus-com.bailando.dtdns.net'>hairremovalplus com</a>
<a href='http://wwwhairremovalpluscom.bailando.dtdns.net'>wwwhairremovalpluscom</a>
<a href='http://www-hairremovalplus-com.bailando.dtdns.net'>www hairremovalplus com</a>
<a href='http://wwwhairremovalplus.bailando.dtdns.net'>wwwhairremovalplus</a>
<a href='http://www-hairremovalplus.bailando.dtdns.net'>www hairremovalplus</a>
<a href='http://revitol.bailando.dtdns.net'>revitol</a>
<a href='http://revitolcom-skin-brightener-cream-.bailando.dtdns.net'>revitolcom skin brightener cream </a>
<a href='http://revitol-com-skin-brightener-cream-.bailando.dtdns.net'>revitol com skin brightener cream </a>
<a href='http://wwwrevitolcom-skin-brightener-cream-.bailando.dtdns.net'>wwwrevitolcom skin brightener cream </a>
<a href='http://www-revitol-com-skin-brightener-cream-.bailando.dtdns.net'>www revitol com skin brightener cream </a>
<a href='http://wwwrevitol.bailando.dtdns.net'>wwwrevitol</a>
<a href='http://www-revitol.bailando.dtdns.net'>www revitol</a>
<a href='http://revitol.bailando.dtdns.net'>revitol</a>
<a href='http://revitolcom-skin-exfoliator-.bailando.dtdns.net'>revitolcom skin exfoliator </a>
<a href='http://revitol-com-skin-exfoliator-.bailando.dtdns.net'>revitol com skin exfoliator </a>
<a href='http://wwwrevitolcom-skin-exfoliator-.bailando.dtdns.net'>wwwrevitolcom skin exfoliator </a>
<a href='http://www-revitol-com-skin-exfoliator-.bailando.dtdns.net'>www revitol com skin exfoliator </a>
<a href='http://wwwrevitol.bailando.dtdns.net'>wwwrevitol</a>
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.