<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://katlas.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ScottManualRobot</id>
	<title>Knot Atlas - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://katlas.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ScottManualRobot"/>
	<link rel="alternate" type="text/html" href="https://katlas.org/wiki/Special:Contributions/ScottManualRobot"/>
	<updated>2026-07-22T00:57:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49557</id>
		<title>WikiLink - The Mediawiki Interface</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49557"/>
		<updated>2006-02-18T19:54:30Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
====License====&lt;br /&gt;
&amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
====Download====&lt;br /&gt;
Download [http://katlas.math.toronto.edu/svn/WikiLink/tags/stable/WikiLink.zip WikiLink.zip]. Unzip this, probably in the same place you&#039;ve unzipped the [[KnotTheory`]] package. This will create a subdirectory called WikiLink, containing (at least) these files:&lt;br /&gt;
{| border=1&lt;br /&gt;
|-&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.nb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica notebook containing wrapper function definitions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.m&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica package automatically generated from &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The WikiLink java classes and source code.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/jdom.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-httpclient-3.0-rc2.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-codec-1.3.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-lang-2.1.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-logging.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
| Libraries (all available under either GPL or the Apache license) required by &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Importing the package in Mathematica====&lt;br /&gt;
First, you&#039;ll need to set some paths, so WikiLink` can find the java files it needs. You need to add the &amp;quot;mathematica/&amp;quot; subdirectory of the WikiLink distribution to the Mathematica $Path.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiLinkPath = &amp;quot;/path/to/WikiLink/mathematica/&amp;quot;;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiLinkPath = &amp;quot;/path/to/WikiLink/mathematica/&amp;quot;;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$AppendTo[$Path, WikiLinkPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AppendTo[$Path, WikiLinkPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$&amp;lt;&amp;lt;WikiLink`$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt;WikiLink`&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then try to connect to the wiki. Executing this line will prompt you for a username and password.&lt;br /&gt;
&amp;lt;!--This instruction is just a fake; we&#039;re not really running this one in Mathematica, because it makes a new WikiLink session! :-)&lt;br /&gt;
&amp;lt;!--CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password:&amp;quot;]&lt;br /&gt;
  ]--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password:&amp;quot;]&lt;br /&gt;
  ]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiUserName[]&amp;lt;/code&amp;gt; checks that we&#039;re logged in&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiUserName[]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName[]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;ScottManualRobot&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
WikiLink` provides functions for checking your login status, getting and setting pages, as well as transparently extending some of Mathematica&#039;s string manipulation functions to wiki pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiGetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiGetPageText[pagename] returns the raw text of the specified page.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[pagename, text] overwrites the contents of the specificied page with the given text.&lt;br /&gt;
WikiSetPageText[pagename, text, summary] overwrites the contents of the specificied page with the given text and notes summary in the change log.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageTexts$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 9 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[{{pagename1, text1},{pagename2,text2},...}] efficiently sets multiple pages, by first checking which texts are already up to date.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiUploadFile$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 10 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUploadFile&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUploadFile[name, description] uploads the specified file to the wiki.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus for example after&lt;br /&gt;
&amp;lt;!--$$WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 11 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;True&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 12 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;A robotic edit, at 19:39, 31-August-2005.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiSetPageTexts&amp;lt;/code&amp;gt; is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won&#039;t change the page text. It takes as argument a list of &amp;lt;code&amp;gt;{&amp;quot;title&amp;quot;, &amp;quot;text&amp;quot;}&amp;lt;/code&amp;gt; pairs, and returns a list of those pairs which failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --~~&amp;quot;&amp;lt;&amp;gt;&amp;quot;~~&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 13 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --~~&amp;quot;&amp;lt;&amp;gt;&amp;quot;~~&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 14 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;The determinant of the knot [[3_1]] is 3.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====String manipulation functions=====&lt;br /&gt;
&amp;lt;code&amp;gt;WikiLink`&amp;lt;/code&amp;gt; provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner, [http://documents.wolfram.com/mathematica/functions/StringMatchQ StringMatchQ], [http://documents.wolfram.com/mathematica/functions/StringFreeQ StringFreeQ], [http://documents.wolfram.com/mathematica/functions/StringReplace StringReplace] or [http://documents.wolfram.com/mathematica/functions/StringCases 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.&lt;br /&gt;
&lt;br /&gt;
You can use these to perform all sorts of editing tricks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiPageMatchQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;determinant&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 15 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiPageMatchQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;determinant&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{False, False}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiPageFreeQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~(DigitCharacter..)~~&amp;quot;_&amp;quot;~~(DigitCharacter..)~~&amp;quot;]]&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 16 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiPageFreeQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~(DigitCharacter..)~~&amp;quot;_&amp;quot;~~(DigitCharacter..)~~&amp;quot;]]&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{True, False}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringCases[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~ShortestMatch[__]~~&amp;quot;]]&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 17 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiStringCases[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~ShortestMatch[__]~~&amp;quot;]]&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{{Sandbox, {[[User:ScottManualRobot|ScottManualRobot]]}}, &lt;br /&gt;
 &lt;br /&gt;
  {Sandbox2, {[[3_1]]}}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringReplace[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;robotic edit&amp;quot;-&amp;gt;&amp;quot;robotic edit (using WikiLink`)]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 18 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiStringReplace[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;robotic edit&amp;quot;-&amp;gt;&amp;quot;robotic edit (using WikiLink`)]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageTexts[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 19 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageTexts[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{{Sandbox, A robotic edit, by\&lt;br /&gt;
 &lt;br /&gt;
    --[[User:ScottManualRobot|ScottManualRobot]] 14:54, 18 Feb 2006\&lt;br /&gt;
 &lt;br /&gt;
    (EST)}, {Sandbox2, The determinant of the knot [[3_1]] is 3.}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
The instruction &amp;lt;code&amp;gt;ShowJavaConsole[]&amp;lt;/code&amp;gt; will bring up a window in which some debugging information is displayed.&lt;br /&gt;
&lt;br /&gt;
====Compatibility====&lt;br /&gt;
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.&lt;br /&gt;
&lt;br /&gt;
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&#039;ve tried this, please let me know about your experiences. I&#039;m hoping that soon (1.5?) [[Special:Import]] will become available, and I can switch to using this. --[[User:Scott|Scott]] 15:57, 31 Aug 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====Todo====&lt;br /&gt;
I&#039;d love to [http://ant.apache.org/manual/develop.html#writingowntask create an Ant task] which allows uploading a file to a wiki. We could then use this in build scripts for KnotTheory, etc. --[[User:Scott|Scott]] 04:07, 17 Sep 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====See Also====&lt;br /&gt;
All of the Mathematica notebooks in [[:Category:Knot Atlas Maintenance Software]] rely on WikiLink, and so are good examples of how to use it.&lt;br /&gt;
&lt;br /&gt;
You may also be interested in the Wikipedia page on [http://en.wikipedia.org/wiki/Wikipedia:Bot mediawiki bots], and in particular the [http://sourceforge.net/projects/pywikipediabot/ Python Wikipedia Robot Framework].&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49501</id>
		<title>WikiLink - The Mediawiki Interface</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49501"/>
		<updated>2006-02-18T17:19:45Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
====License====&lt;br /&gt;
&amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
====Download====&lt;br /&gt;
Download [http://katlas.math.toronto.edu/svn/WikiLink/tags/stable/WikiLink.zip WikiLink.zip]. Unzip this, probably in the same place you&#039;ve unzipped the [[KnotTheory`]] package. This will create a subdirectory called WikiLink, containing (at least) these files:&lt;br /&gt;
{| border=1&lt;br /&gt;
|-&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.nb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica notebook containing wrapper function definitions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.m&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica package automatically generated from &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The WikiLink java classes and source code.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/jdom.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-httpclient-3.0-rc2.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-codec-1.3.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-lang-2.1.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-logging.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
| Libraries (all available under either GPL or the Apache license) required by &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Importing the package in Mathematica====&lt;br /&gt;
First, you&#039;ll need to set some paths, so WikiLink` can find the java files it needs. You need to add the &amp;quot;mathematica/&amp;quot; subdirectory of the WikiLink distribution to the Mathematica $Path.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiLinkPath = &amp;quot;/path/to/WikiLink/mathematica/&amp;quot;;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiLinkPath = &amp;quot;/path/to/WikiLink/mathematica/&amp;quot;;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$AppendTo[$Path, WikiLinkPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AppendTo[$Path, WikiLinkPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$&amp;lt;&amp;lt;WikiLink`$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt;WikiLink`&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then try to connect to the wiki. Executing this line will prompt you for a username and password.&lt;br /&gt;
&amp;lt;!--This instruction is just a fake; we&#039;re not really running this one in Mathematica, because it makes a new WikiLink session! :-)&lt;br /&gt;
&amp;lt;!--CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password:&amp;quot;]&lt;br /&gt;
  ]--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password:&amp;quot;]&lt;br /&gt;
  ]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiUserName[]&amp;lt;/code&amp;gt; checks that we&#039;re logged in&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiUserName[]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName[]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;ScottManualRobot&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
WikiLink` provides functions for checking your login status, getting and setting pages, as well as transparently extending some of Mathematica&#039;s string manipulation functions to wiki pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiGetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiGetPageText[pagename] returns the raw text of the specified page.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[pagename, text] overwrites the contents of the specificied page with the given text.&lt;br /&gt;
WikiSetPageText[pagename, text, summary] overwrites the contents of the specificied page with the given text and notes summary in the change log.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageTexts$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 9 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[{{pagename1, text1},{pagename2,text2},...}] efficiently sets multiple pages, by first checking which texts are already up to date.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiUploadFile$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 10 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUploadFile&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUploadFile[name, description] uploads the specified file to the wiki.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus for example after&lt;br /&gt;
&amp;lt;!--$$WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 11 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;True&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 12 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;A robotic edit, at 19:39, 31-August-2005.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiSetPageTexts&amp;lt;/code&amp;gt; is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won&#039;t change the page text. It takes as argument a list of &amp;lt;code&amp;gt;{&amp;quot;title&amp;quot;, &amp;quot;text&amp;quot;}&amp;lt;/code&amp;gt; pairs, and returns a list of those pairs which failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --~~&amp;quot;&amp;lt;&amp;gt;&amp;quot;~~&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 13 |&lt;br /&gt;
in = WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --~~&amp;quot;&amp;lt;&amp;gt;&amp;quot;~~&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}] |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 14 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= The determinant of the knot [[3_1]] is 3.}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====String manipulation functions=====&lt;br /&gt;
&amp;lt;code&amp;gt;WikiLink`&amp;lt;/code&amp;gt; provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner, [http://documents.wolfram.com/mathematica/functions/StringMatchQ StringMatchQ], [http://documents.wolfram.com/mathematica/functions/StringFreeQ StringFreeQ], [http://documents.wolfram.com/mathematica/functions/StringReplace StringReplace] or [http://documents.wolfram.com/mathematica/functions/StringCases 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.&lt;br /&gt;
&lt;br /&gt;
You can use these to perform all sorts of editing tricks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiPageMatchQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;determinant&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 15 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiPageMatchQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;determinant&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{False, False}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiPageFreeQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~(DigitCharacter..)~~&amp;quot;_&amp;quot;~~(DigitCharacter..)~~&amp;quot;]]&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 16 |&lt;br /&gt;
in = WikiPageFreeQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~(DigitCharacter..)~~&amp;quot;_&amp;quot;~~(DigitCharacter..)~~&amp;quot;]]&amp;quot;] |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{True, False}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringCases[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~ShortestMatch[__]~~&amp;quot;]]&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 17 |&lt;br /&gt;
in = WikiStringCases[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~ShortestMatch[__]~~&amp;quot;]]&amp;quot;] |&lt;br /&gt;
out= {{Sandbox, {[[User:ScottManualRobot|ScottManualRobot]]}}, &lt;br /&gt;
 &lt;br /&gt;
  {Sandbox2, {[[3_1]]}}}}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringReplace[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;robotic edit&amp;quot;-&amp;gt;&amp;quot;robotic edit (using WikiLink`)]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 18 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiStringReplace[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;robotic edit&amp;quot;-&amp;gt;&amp;quot;robotic edit (using WikiLink`)]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageTexts[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 19 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageTexts[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= {{Sandbox, A robotic edit, by\&lt;br /&gt;
 &lt;br /&gt;
    --[[User:ScottManualRobot|ScottManualRobot]] 12:19, 18 Feb 2006\&lt;br /&gt;
 &lt;br /&gt;
    (EST)}, {Sandbox2, The determinant of the knot [[3_1]] is 3.}}}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
The instruction &amp;lt;code&amp;gt;ShowJavaConsole[]&amp;lt;/code&amp;gt; will bring up a window in which some debugging information is displayed.&lt;br /&gt;
&lt;br /&gt;
====Compatibility====&lt;br /&gt;
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.&lt;br /&gt;
&lt;br /&gt;
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&#039;ve tried this, please let me know about your experiences. I&#039;m hoping that soon (1.5?) [[Special:Import]] will become available, and I can switch to using this. --[[User:Scott|Scott]] 15:57, 31 Aug 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====Todo====&lt;br /&gt;
I&#039;d love to [http://ant.apache.org/manual/develop.html#writingowntask create an Ant task] which allows uploading a file to a wiki. We could then use this in build scripts for KnotTheory, etc. --[[User:Scott|Scott]] 04:07, 17 Sep 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====See Also====&lt;br /&gt;
All of the Mathematica notebooks in [[:Category:Knot Atlas Maintenance Software]] rely on WikiLink, and so are good examples of how to use it.&lt;br /&gt;
&lt;br /&gt;
You may also be interested in the Wikipedia page on [http://en.wikipedia.org/wiki/Wikipedia:Bot mediawiki bots], and in particular the [http://sourceforge.net/projects/pywikipediabot/ Python Wikipedia Robot Framework].&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49497</id>
		<title>WikiLink - The Mediawiki Interface</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49497"/>
		<updated>2006-02-18T17:01:26Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
====License====&lt;br /&gt;
&amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
====Download====&lt;br /&gt;
Download [http://katlas.math.toronto.edu/svn/WikiLink/tags/stable/WikiLink.zip WikiLink.zip]. Unzip this, probably in the same place you&#039;ve unzipped the [[KnotTheory`]] package. This will create a subdirectory called WikiLink, containing (at least) these files:&lt;br /&gt;
{| border=1&lt;br /&gt;
|-&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.nb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica notebook containing wrapper function definitions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.m&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica package automatically generated from &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The WikiLink java classes and source code.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/jdom.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-httpclient-3.0-rc2.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-codec-1.3.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-lang-2.1.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-logging.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
| Libraries (all available under either GPL or the Apache license) required by &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Importing the package in Mathematica====&lt;br /&gt;
First, you&#039;ll need to set some paths, so WikiLink` can find the java files it needs. You need to add the &amp;quot;mathematica/&amp;quot; subdirectory of the WikiLink distribution to the Mathematica $Path.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiLinkPath = &amp;quot;/path/to/WikiLink/mathematica/&amp;quot;;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiLinkPath = &amp;quot;/path/to/WikiLink/mathematica/&amp;quot;;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$AppendTo[$Path, WikiLinkPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AppendTo[$Path, WikiLinkPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$&amp;lt;&amp;lt;WikiLink`$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt;WikiLink`&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then try to connect to the wiki. Executing this line will prompt you for a username and password.&lt;br /&gt;
&amp;lt;!--This instruction is just a fake; we&#039;re not really running this one in Mathematica, because it makes a new WikiLink session! :-)&lt;br /&gt;
&amp;lt;!--CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password:&amp;quot;]&lt;br /&gt;
  ]--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password:&amp;quot;]&lt;br /&gt;
  ]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiUserName[]&amp;lt;/code&amp;gt; checks that we&#039;re logged in&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiUserName[]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName[]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;ScottManualRobot&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
WikiLink` provides functions for checking your login status, getting and setting pages, as well as transparently extending some of Mathematica&#039;s string manipulation functions to wiki pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiGetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiGetPageText[pagename] returns the raw text of the specified page.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[pagename, text] overwrites the contents of the specificied page with the given text.&lt;br /&gt;
WikiSetPageText[pagename, text, summary] overwrites the contents of the specificied page with the given text and notes summary in the change log.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageTexts$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 9 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[{{pagename1, text1},{pagename2,text2},...}] efficiently sets multiple pages, by first checking which texts are already up to date.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiUploadFile$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 10 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUploadFile&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUploadFile[name, description] uploads the specified file to the wiki.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus for example after&lt;br /&gt;
&amp;lt;!--$$WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 11 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;True&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 12 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;A robotic edit, at 19:39, 31-August-2005.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiSetPageTexts&amp;lt;/code&amp;gt; is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won&#039;t change the page text. It takes as argument a list of &amp;lt;code&amp;gt;{&amp;quot;title&amp;quot;, &amp;quot;text&amp;quot;}&amp;lt;/code&amp;gt; pairs, and returns a list of those pairs which failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --~~&amp;quot;&amp;lt;&amp;gt;&amp;quot;~~&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 13 |&lt;br /&gt;
in = WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --~~&amp;quot;&amp;lt;&amp;gt;&amp;quot;~~&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}] |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 14 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= The determinant of the knot [[3_1]] is 3.}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====String manipulation functions=====&lt;br /&gt;
&amp;lt;code&amp;gt;WikiLink`&amp;lt;/code&amp;gt; provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner, [http://documents.wolfram.com/mathematica/functions/StringMatchQ StringMatchQ], [http://documents.wolfram.com/mathematica/functions/StringFreeQ StringFreeQ], [http://documents.wolfram.com/mathematica/functions/StringReplace StringReplace] or [http://documents.wolfram.com/mathematica/functions/StringCases 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.&lt;br /&gt;
&lt;br /&gt;
You can use these to perform all sorts of editing tricks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiPageMatchQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;determinant&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 15 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiPageMatchQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;determinant&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{False, False}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiPageFreeQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~(DigitCharacter..)~~&amp;quot;_&amp;quot;~~(DigitCharacter..)~~&amp;quot;]]&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 16 |&lt;br /&gt;
in = WikiPageFreeQ[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~(DigitCharacter..)~~&amp;quot;_&amp;quot;~~(DigitCharacter..)~~&amp;quot;]]&amp;quot;] |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{True, False}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringCases[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~ShortestMatch[__]~~&amp;quot;]]&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 17 |&lt;br /&gt;
in = WikiStringCases[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;[[&amp;quot;~~ShortestMatch[__]~~&amp;quot;]]&amp;quot;] |&lt;br /&gt;
out= {{Sandbox, {[[User:ScottManualRobot|ScottManualRobot]]}}, &lt;br /&gt;
 &lt;br /&gt;
  {Sandbox2, {[[3_1]]}}}}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringReplace[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;robotic edit&amp;quot;-&amp;gt;&amp;quot;robotic edit (using WikiLink`)]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 18 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiStringReplace[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}, &amp;quot;robotic edit&amp;quot;-&amp;gt;&amp;quot;robotic edit (using WikiLink`)]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageTexts[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 19 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageTexts[{&amp;quot;Sandbox&amp;quot;, &amp;quot;Sandbox2&amp;quot;}]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= {{Sandbox, A robotic edit, by\&lt;br /&gt;
 &lt;br /&gt;
    --[[User:ScottManualRobot|ScottManualRobot]] 12:01, 18 Feb 2006\&lt;br /&gt;
 &lt;br /&gt;
    (EST)}, {Sandbox2, The determinant of the knot [[3_1]] is 3.}}}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
The instruction &amp;lt;code&amp;gt;ShowJavaConsole[]&amp;lt;/code&amp;gt; will bring up a window in which some debugging information is displayed.&lt;br /&gt;
&lt;br /&gt;
====Compatibility====&lt;br /&gt;
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.&lt;br /&gt;
&lt;br /&gt;
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&#039;ve tried this, please let me know about your experiences. I&#039;m hoping that soon (1.5?) [[Special:Import]] will become available, and I can switch to using this. --[[User:Scott|Scott]] 15:57, 31 Aug 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====Todo====&lt;br /&gt;
I&#039;d love to [http://ant.apache.org/manual/develop.html#writingowntask create an Ant task] which allows uploading a file to a wiki. We could then use this in build scripts for KnotTheory, etc. --[[User:Scott|Scott]] 04:07, 17 Sep 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====See Also====&lt;br /&gt;
All of the Mathematica notebooks in [[:Category:Knot Atlas Maintenance Software]] rely on WikiLink, and so are good examples of how to use it.&lt;br /&gt;
&lt;br /&gt;
You may also be interested in the Wikipedia page on [http://en.wikipedia.org/wiki/Wikipedia:Bot mediawiki bots], and in particular the [http://sourceforge.net/projects/pywikipediabot/ Python Wikipedia Robot Framework].&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49491</id>
		<title>WikiLink - The Mediawiki Interface</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=49491"/>
		<updated>2006-02-18T16:56:50Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
====License====&lt;br /&gt;
&amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
====Download====&lt;br /&gt;
Download [http://katlas.math.toronto.edu/svn/WikiLink/tags/stable/WikiLink.zip WikiLink.zip]. Unzip this, probably in the same place you&#039;ve unzipped the [[KnotTheory`]] package. This will create a subdirectory called WikiLink, containing (at least) these files:&lt;br /&gt;
{| border=1&lt;br /&gt;
|-&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.nb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica notebook containing wrapper function definitions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;mathematica/WikiLink.m&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica package automatically generated from &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The WikiLink java classes and source code.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/jdom.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-httpclient-3.0-rc2.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-codec-1.3.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-lang-2.1.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;jars/commons-logging.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
| Libraries (all available under either GPL or the Apache license) required by &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Importing the package in Mathematica====&lt;br /&gt;
First, you&#039;ll need to set some paths, so WikiLink` can find the java files it needs. You need to add the &amp;quot;mathematica/&amp;quot; subdirectory of the WikiLink distribution to the Mathematica $Path.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiLinkPath = &amp;amp;quot;/path/to/WikiLink/mathematica/&amp;amp;quot;;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiLinkPath = &amp;amp;quot;/path/to/WikiLink/mathematica/&amp;amp;quot;;&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$AppendTo[$Path, WikiLinkPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AppendTo[$Path, WikiLinkPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$&amp;lt;&amp;lt;WikiLink`$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt;WikiLink`&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then try to connect to the wiki. Executing this line will prompt you for a username and password.&lt;br /&gt;
&amp;lt;!--This instruction is just a fake; we&#039;re not really running this one in Mathematica, because it makes a new WikiLink session! :-)&lt;br /&gt;
&amp;lt;!--CreateWikiConnection[&lt;br /&gt;
  &amp;amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;amp;quot;,&lt;br /&gt;
  InputString[&amp;amp;quot;Enter Your Username:&amp;amp;quot;],&lt;br /&gt;
  InputString[&amp;amp;quot;Enter Your Password&amp;amp;quot;]&lt;br /&gt;
  ]--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;CreateWikiConnection[&lt;br /&gt;
  &amp;amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;amp;quot;,&lt;br /&gt;
  InputString[&amp;amp;quot;Enter Your Username:&amp;amp;quot;],&lt;br /&gt;
  InputString[&amp;amp;quot;Enter Your Password&amp;amp;quot;]&lt;br /&gt;
  ]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiUserName[]&amp;lt;/code&amp;gt; checks that we&#039;re logged in&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiUserName[]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName[]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;ScottManualRobot&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
WikiLink` provides functions for checking your login status, getting and setting pages, as well as transparently extending some of Mathematica&#039;s string manipulation functions to wiki pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiGetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiGetPageText[pagename] returns the raw text of the specified page.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[pagename, text] overwrites the contents of the specificied page with the given text.&lt;br /&gt;
WikiSetPageText[pagename, text, summary] overwrites the contents of the specificied page with the given text and notes summary in the change log.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageTexts$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 9 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[{{pagename1, text1},{pagename2,text2},...}] efficiently sets multiple pages, by first checking which texts are already up to date.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiUploadFile$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 10 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUploadFile&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUploadFile[name, description] uploads the specified file to the wiki.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus for example after&lt;br /&gt;
&amp;lt;!--$$WikiSetPageText[&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 11 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText[&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;amp;quot;Sandbox&amp;amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 12 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;amp;quot;Sandbox&amp;amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiSetPageTexts&amp;lt;/code&amp;gt; is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won&#039;t change the page text. It takes as argument a list of &amp;lt;code&amp;gt;{&amp;amp;quot;title&amp;amp;quot;, &amp;amp;quot;text&amp;amp;quot;}&amp;lt;/code&amp;gt; pairs, and returns a list of those pairs which failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiSetPageTexts[{{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;A robotic edit, by --~~&amp;amp;quot;&amp;lt;&amp;gt;&amp;amp;quot;~~&amp;amp;quot;}, {&amp;amp;quot;Sandbox2&amp;amp;quot;, &amp;amp;quot;The determinant of the knot [[3_1]] is 3.&amp;amp;quot;}}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 13 |&lt;br /&gt;
in = WikiSetPageTexts[{{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;A robotic edit, by --~~&amp;amp;quot;&amp;lt;&amp;gt;&amp;amp;quot;~~&amp;amp;quot;}, {&amp;amp;quot;Sandbox2&amp;amp;quot;, &amp;amp;quot;The determinant of the knot [[3_1]] is 3.&amp;amp;quot;}}] |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;amp;quot;Sandbox2&amp;amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 14 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;amp;quot;Sandbox2&amp;amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====String manipulation functions=====&lt;br /&gt;
&amp;lt;code&amp;gt;WikiLink`&amp;lt;/code&amp;gt; provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner, [http://documents.wolfram.com/mathematica/functions/StringMatchQ StringMatchQ], [http://documents.wolfram.com/mathematica/functions/StringFreeQ StringFreeQ], [http://documents.wolfram.com/mathematica/functions/StringReplace StringReplace] or [http://documents.wolfram.com/mathematica/functions/StringCases 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.&lt;br /&gt;
&lt;br /&gt;
You can use these to perform all sorts of editing tricks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiPageMatchQ[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;determinant&amp;amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 15 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiPageMatchQ[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;determinant&amp;amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiPageFreeQ[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;[[&amp;amp;quot;~~(DigitCharacter..)~~&amp;amp;quot;_&amp;amp;quot;~~(DigitCharacter..)~~&amp;amp;quot;]]&amp;amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 16 |&lt;br /&gt;
in = WikiPageFreeQ[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;[[&amp;amp;quot;~~(DigitCharacter..)~~&amp;amp;quot;_&amp;amp;quot;~~(DigitCharacter..)~~&amp;amp;quot;]]&amp;amp;quot;] |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringCases[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;[[&amp;amp;quot;~~ShortestMatch[__]~~&amp;amp;quot;]]&amp;amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 17 |&lt;br /&gt;
in = WikiStringCases[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;[[&amp;amp;quot;~~ShortestMatch[__]~~&amp;amp;quot;]]&amp;amp;quot;] |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiStringReplace[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;robotic edit&amp;amp;quot;-&amp;gt;&amp;amp;quot;robotic edit (using WikiLink`)]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 18 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiStringReplace[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}, &amp;amp;quot;robotic edit&amp;amp;quot;-&amp;gt;&amp;amp;quot;robotic edit (using WikiLink`)]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageTexts[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 19 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageTexts[{&amp;amp;quot;Sandbox&amp;amp;quot;, &amp;amp;quot;Sandbox2&amp;amp;quot;}]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;$Failed&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
The instruction &amp;lt;code&amp;gt;ShowJavaConsole[]&amp;lt;/code&amp;gt; will bring up a window in which some debugging information is displayed.&lt;br /&gt;
&lt;br /&gt;
====Compatibility====&lt;br /&gt;
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.&lt;br /&gt;
&lt;br /&gt;
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&#039;ve tried this, please let me know about your experiences. I&#039;m hoping that soon (1.5?) [[Special:Import]] will become available, and I can switch to using this. --[[User:Scott|Scott]] 15:57, 31 Aug 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====Todo====&lt;br /&gt;
I&#039;d love to [http://ant.apache.org/manual/develop.html#writingowntask create an Ant task] which allows uploading a file to a wiki. We could then use this in build scripts for KnotTheory, etc. --[[User:Scott|Scott]] 04:07, 17 Sep 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
====See Also====&lt;br /&gt;
All of the Mathematica notebooks in [[:Category:Knot Atlas Maintenance Software]] rely on WikiLink, and so are good examples of how to use it.&lt;br /&gt;
&lt;br /&gt;
You may also be interested in the Wikipedia page on [http://en.wikipedia.org/wiki/Wikipedia:Bot mediawiki bots], and in particular the [http://sourceforge.net/projects/pywikipediabot/ Python Wikipedia Robot Framework].&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=Who_Am_I&amp;diff=49505</id>
		<title>Who Am I</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=Who_Am_I&amp;diff=49505"/>
		<updated>2006-02-18T16:55:58Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[User:ScottManualRobot|ScottManualRobot]]&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=Naming_and_Enumeration&amp;diff=49435</id>
		<title>Naming and Enumeration</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=Naming_and_Enumeration&amp;diff=49435"/>
		<updated>2006-02-14T20:27:59Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Manual TOC Sidebar}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;KnotTheory`&amp;lt;/code&amp;gt; comes loaded with some knot tables; currently, the Rolfsen table of prime knots with up to 10 crossings {{ref|Rolfsen}}, the Hoste-Thistlethwaite tables of prime knots with up to 16 crossings and the Thistlethwaite table of prime links with up to 11 crossings (see [[Further Knot Theory Software#Knotscape|Knotscape]]):&lt;br /&gt;
&lt;br /&gt;
{{Startup Note}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?Knot$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Knot&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;Knot[n, k] denotes the kth knot with n crossings in the Rolfsen table. Knot[n, Alternating, k] (for n between 11 and 16) denotes the kth alternating n-crossing knot in the Hoste-Thistlethwaite table. Knot[n, NonAlternating, k] denotes the kth non alternating n-crossing knot in the Hoste-Thistlethwaite table.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?Link$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Link&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;Link[n, Alternating, k] denotes the kth alternating n-crossing link in the Thistlethwaite table. Link[n, NonAlternating, k] denotes the kth non alternating n-crossing link in the Thistlethwaite table.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Knot Image Pair|6_1|gif|9_46|gif}}&lt;br /&gt;
&lt;br /&gt;
Thus, for example, let us verify that the knots [[6_1]] and [[9_46]] have the same Alexander polynomial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Alexander[Knot[6, 1]][t]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Alexander[Knot[6, 1]][t]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;    2&lt;br /&gt;
5 - - - 2 t&lt;br /&gt;
    t&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Alexander[Knot[9, 46]][t]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Alexander[Knot[9, 46]][t]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;    2&lt;br /&gt;
5 - - - 2 t&lt;br /&gt;
    t&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Knot Image|L6a4|gif}}&lt;br /&gt;
&lt;br /&gt;
We can also check that the Borromean rings, [[L6a4]] in the Thistlethwaite table, is a 3-component link:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Length[Skeleton[Link[6, Alternating, 4]]]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Length[Skeleton[Link[6, Alternating, 4]]]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;3&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?AllKnots$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AllKnots&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;AllKnots[] return a list of all knots with up to 11 crossings. AllKnots[n_] returns a list of all knots with n crossings, up to 16. AllKnots[{n_,m_}] returns a list of all knots with between n and m crossings, and AllKnots[n_,Alternating&amp;amp;#124;NonAlternating] returns all knots with n crossings of the specified type.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?AllLinks$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AllLinks&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;AllLinks[] return a list of all links with up to 11 crossings. AllLinks[n_] returns a list of all links with n crossings, up to 12.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus at the moment there are 1701936 knots and 5700 links known to &amp;lt;code&amp;gt;KnotTheory`&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Length /@ {AllKnots[{0,16}], AllLinks[{2,12}]}$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Length /@ {AllKnots[{0,16}], AllLinks[{2,12}]}&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{1701936, 5700}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Show[DrawPD[Knot[13, NonAlternating, 5016], {Gap -&amp;gt; 0.025}]]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{Graphics|&lt;br /&gt;
n  = 10 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Show[DrawPD[Knot[13, NonAlternating, 5016], {Gap -&amp;gt; 0.025}]]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
img= Naming_and_Enumeration_Out_9.gif |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;-Graphics-&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Shumakovitch had noticed that this nice knot has interesting Khovanov homology; see {{ref|Shumakovitch}}).&lt;br /&gt;
&lt;br /&gt;
{{Knot Image|T(5,3)|jpg}}&lt;br /&gt;
&lt;br /&gt;
In addition to the tables, KnotTheory` also knows about torus knots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?TorusKnot$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 11 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;TorusKnot&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;TorusKnot[m, n] represents the (m,n) torus knot.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?TorusKnots$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 12 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;TorusKnots&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;TorusKnots[n_] returns a list of all torus knots with up to n crossings.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the torus knots [[T(5,3)]] and T(3,5) have different presentations with different numbers of crossings, but they are in fact isotopic, and hence they have the same invariants (and in particular the same type 3 Vassiliev invariant &amp;lt;math&amp;gt;V_3&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Crossings /@ {TorusKnot[5, 3], TorusKnot[3, 5]}$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 13 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Crossings /@ {TorusKnot[5, 3], TorusKnot[3, 5]}&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{10, 12}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Vassiliev[3] /@ {TorusKnot[5, 3], TorusKnot[3, 5]}$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 14 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Vassiliev[3] /@ {TorusKnot[5, 3], TorusKnot[3, 5]}&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{20, 20}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KnotTheory` knows how to plot torus knots; see [[Drawing with TubePlot]]. &lt;br /&gt;
&lt;br /&gt;
You can also use the function Knot to parse certain string representations of named knots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$Knot /@ {&amp;quot;K11a14&amp;quot;, &amp;quot;11a_14&amp;quot;, &amp;quot;L8a1&amp;quot;, &amp;quot;T(3,5)&amp;quot;}$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 15 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;Knot /@ {&amp;quot;K11a14&amp;quot;, &amp;quot;11a_14&amp;quot;, &amp;quot;L8a1&amp;quot;, &amp;quot;T(3,5)&amp;quot;}&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{Knot[11, Alternating, 14], Knot[11, Alternating, 14], &lt;br /&gt;
 &lt;br /&gt;
  Link[8, Alternating, 1], TorusKnot[3, 5]}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the opposite direction, the function NameString produces the standard name for a knot, used throughout the Knot Atlas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$NameString /@ {Knot[11, Alternating, 14], TorusKnot[3,5]}$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 16 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;NameString /@ {Knot[11, Alternating, 14], TorusKnot[3,5]}&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{K11a14, T(3,5)}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
{{note|Rolfsen}} D. Rolfsen, &#039;&#039;Knots and Links&#039;&#039;, Publish or Perish, Mathematics Lecture Series 7, Wilmington 1976.&lt;br /&gt;
&lt;br /&gt;
{{note|Shumakovitch}}  A. Shumakovitch, &#039;&#039;Torsion of the Khovanov Homology&#039;&#039;, [http://front.math.ucdavis.edu/math.GT/0405474 arXiv:math.GT/0405474].&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=Who_Am_I&amp;diff=49409</id>
		<title>Who Am I</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=Who_Am_I&amp;diff=49409"/>
		<updated>2006-02-14T18:44:21Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[User:ScottManualRobot|ScottManualRobot]]&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=41772</id>
		<title>WikiLink - The Mediawiki Interface</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=41772"/>
		<updated>2005-08-31T19:48:35Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Manual TOC Sidebar}}&lt;br /&gt;
&lt;br /&gt;
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, whie the java class, and its addition functionality, will be documented elsewhere.&lt;br /&gt;
====License====&lt;br /&gt;
&amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt; are copyright Scott Morrison, available under your choice of the MIT or GPL licenses. The other components are copyright by other parties, all available under the Apache license.&lt;br /&gt;
&lt;br /&gt;
====Download====&lt;br /&gt;
Download [[Media:WikiLink.zip|WikiLink.zip]] ([[Image:WikiLink.zip|file description]]). Unzip this, probably in the same place you&#039;ve unzipped the [[KnotTheory`]] package. This will create a subdirectory called WikiLink, containing (at least) these files:&lt;br /&gt;
{| border=1&lt;br /&gt;
|-&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica notebook containing wrapper function definitions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica package automatically generated from &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The WikiLink java class and source code ([[MediawikiConnection.java]]).&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;tt&amp;gt;jdom.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-httpclient-3.0-rc2.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-codec-1.3.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-lang-2.1.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-logging.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
| Libraries (all available under either GPL or the Apache license) required by &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Importing the package in Mathematica====&lt;br /&gt;
First, you&#039;ll need to set some paths, so WikiLink` can find the java files it needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$KnotAtlasPath = &amp;quot;c:\\scott\\math.berkeley.edu\\Work\\Mathematica\\KnotAtlas\\&amp;quot;;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;KnotAtlasPath = &amp;quot;c:\\scott\\math.berkeley.edu\\Work\\Mathematica\\KnotAtlas\\&amp;quot;;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$AppendTo[$Path, KnotAtlasPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AppendTo[$Path, KnotAtlasPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$SetDirectory[KnotAtlasPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;SetDirectory[KnotAtlasPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$&amp;lt;&amp;lt; &amp;quot;WikiLink\\WikiLink.m&amp;quot;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt; &amp;quot;WikiLink\\WikiLink.m&amp;quot;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$SetJarPath[KnotAtlasPath &amp;lt;&amp;gt; &amp;quot;WikiLink\\&amp;quot;];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;SetJarPath[KnotAtlasPath &amp;lt;&amp;gt; &amp;quot;WikiLink\\&amp;quot;];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then try to connect to the wiki. Executing this line will prompt you for a username and password.&lt;br /&gt;
&amp;lt;!--This instruction is just a fake; we&#039;re not really running this one in Mathematica, because it makes a new WikiLink session! :-)&lt;br /&gt;
&amp;lt;!--CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password&amp;quot;]&lt;br /&gt;
  ]--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password&amp;quot;]&lt;br /&gt;
  ]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiUserName[]&amp;lt;/code&amp;gt; checks that we&#039;re logged in&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiUserName[]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName[]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;ScottManualRobot&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
WikiLink` provides only a few functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiGetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiGetPageText[pagename] returns the raw text of the specified page.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 9 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[pagename, text] overwrites the contents of the specificied page with the given text.&lt;br /&gt;
WikiSetPageText[pagename, text, summary] overwrites the contents of the specificied page with the given text and notes summary in the change log.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageTexts$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 10 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[{{pagename1, text1},{pagename2,text2},...}] efficiently sets multiple pages, by first checking which texts are already up to date.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiUploadFile$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 11 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUploadFile&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUploadFile[name, description] uploads the specified file to the wiki.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus for example after&lt;br /&gt;
&amp;lt;!--$$WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 12 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, at 19:39, 31-August-2005.&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;True&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 13 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;A robotic edit, at 19:39, 31-August-2005.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiSetPageTexts&amp;lt;/code&amp;gt; is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won&#039;t change the page text. It takes as argument a list of &amp;lt;code&amp;gt;{&amp;quot;title&amp;quot;, &amp;quot;text&amp;quot;}&amp;lt;/code&amp;gt; pairs, and returns a list of those pairs which failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --&amp;quot;&amp;lt;&amp;gt;&amp;quot;[[User:Scott|Scott]] 15:39, 31 Aug 2005 (EDT)&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 14 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --&amp;quot;&amp;lt;&amp;gt;&amp;quot;[[User:Scott&amp;amp;#124;Scott]] 15:39, 31 Aug 2005 (EDT)&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 15 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;The determinant of the knot [[3_1]] is 3.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
The instruction &amp;lt;code&amp;gt;ShowJavaConsole[]&amp;lt;/code&amp;gt; will bring up a window in which some debugging information is displayed.&lt;br /&gt;
&lt;br /&gt;
====Compatibility====&lt;br /&gt;
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=41766</id>
		<title>WikiLink - The Mediawiki Interface</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=41766"/>
		<updated>2005-08-31T19:36:48Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Manual TOC Sidebar}}&lt;br /&gt;
&lt;br /&gt;
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, whie the java class, and its addition functionality, will be documented elsewhere.&lt;br /&gt;
====License====&lt;br /&gt;
&amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt; are copyright Scott Morrison, available under your choice of the MIT or GPL licenses. The other components are copyright by other parties, all available under the Apache license.&lt;br /&gt;
&lt;br /&gt;
====Download====&lt;br /&gt;
Download [[Media:WikiLink.zip|WikiLink.zip]] ([[Image:WikiLink.zip|file description]]). Unzip this, probably in the same place you&#039;ve unzipped the [[KnotTheory`]] package. This will create a subdirectory called WikiLink, containing (at least) these files:&lt;br /&gt;
{| border=1&lt;br /&gt;
|-&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica notebook containing wrapper function definitions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica package automatically generated from &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The WikiLink java class and source code ([[MediawikiConnection.java]]).&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;tt&amp;gt;jdom.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-httpclient-3.0-rc2.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-codec-1.3.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-lang-2.1.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-logging.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
| Libraries (all available under either GPL or the Apache license) required by &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Importing the package in Mathematica====&lt;br /&gt;
First, you&#039;ll need to set some paths, so WikiLink` can find the java files it needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$KnotAtlasPath = &amp;quot;c:\\scott\\math.berkeley.edu\\Work\\Mathematica\\KnotAtlas\\&amp;quot;;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;KnotAtlasPath = &amp;quot;c:\\scott\\math.berkeley.edu\\Work\\Mathematica\\KnotAtlas\\&amp;quot;;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$AppendTo[$Path, KnotAtlasPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AppendTo[$Path, KnotAtlasPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$SetDirectory[KnotAtlasPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;SetDirectory[KnotAtlasPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$&amp;lt;&amp;lt; &amp;quot;WikiLink\\WikiLink.m&amp;quot;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt; &amp;quot;WikiLink\\WikiLink.m&amp;quot;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$SetJarPath[KnotAtlasPath &amp;lt;&amp;gt; &amp;quot;WikiLink\\&amp;quot;];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;SetJarPath[KnotAtlasPath &amp;lt;&amp;gt; &amp;quot;WikiLink\\&amp;quot;];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then try to connect to the wiki. Executing this line will prompt you for a username and password.&lt;br /&gt;
&amp;lt;!--$$CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  wikiUserName=InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password&amp;quot;]&lt;br /&gt;
  ]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  wikiUserName=InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password&amp;quot;]&lt;br /&gt;
  ]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiUserName[]&amp;lt;/code&amp;gt; checks that we&#039;re logged in&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, your IP address if you&#039;re not logged in, or $Failed if something more complicated has happened!&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiUserName[]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName[]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;ScottManualRobot&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
WikiLink` provides only a few functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$?WikiGetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 9 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiGetPageText[pagename] returns the raw text of the specified page.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageText$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 10 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[pagename, text] overwrites the contents of the specificied page with the given text.&lt;br /&gt;
WikiSetPageText[pagename, text, summary] overwrites the contents of the specificied page with the given text and notes summary in the change log.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiSetPageTexts$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 11 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiSetPageText[{{pagename1, text1},{pagename2,text2},...}] efficiently sets multiple pages, by first checking which texts are already up to date.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$?WikiUploadFile$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 12 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUploadFile&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUploadFile[name, description] uploads the specified file to the wiki.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus for example after&lt;br /&gt;
&amp;lt;!--$$WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --[[User:Scott|Scott]]&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 13 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageText[&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --[[User:Scott&amp;amp;#124;Scott]]&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;True&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 14 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;A robotic edit, by --[[User:Scott&amp;amp;#124;Scott]]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiSetPageTexts&amp;lt;/code&amp;gt; is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won&#039;t change the page text. It takes as argument a list of &amp;lt;code&amp;gt;{&amp;quot;title&amp;quot;, &amp;quot;text&amp;quot;}&amp;lt;/code&amp;gt; pairs, and returns a list of those pairs which failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --[[User:Scott|Scott]]&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 15 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiSetPageTexts[{{&amp;quot;Sandbox&amp;quot;, &amp;quot;A robotic edit, by --[[User:Scott&amp;amp;#124;Scott]]&amp;quot;}, {&amp;quot;Sandbox2&amp;quot;, &amp;quot;The determinant of the knot [[3_1]] is 3.&amp;quot;}}]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;{}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 16 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiGetPageText[&amp;quot;Sandbox2&amp;quot;]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;The determinant of the knot [[3_1]] is 3.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
The instruction &amp;lt;code&amp;gt;ShowJavaConsole[]&amp;lt;/code&amp;gt; will bring up a window in which some debugging information is displayed.&lt;br /&gt;
&lt;br /&gt;
====Compatibility====&lt;br /&gt;
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=41757</id>
		<title>WikiLink - The Mediawiki Interface</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=WikiLink_-_The_Mediawiki_Interface&amp;diff=41757"/>
		<updated>2005-08-31T19:03:38Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Manual TOC Sidebar}}&lt;br /&gt;
&lt;br /&gt;
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, whie the java class, and its addition functionality, will be documented elsewhere.&lt;br /&gt;
====License====&lt;br /&gt;
&amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt; are copyright Scott Morrison, available under your choice of the MIT or GPL licenses. The other components are copyright by other parties, all available under the Apache license.&lt;br /&gt;
&lt;br /&gt;
====Download====&lt;br /&gt;
Download [[Media:WikiLink.zip|WikiLink.zip]] ([[Image:WikiLink.zip|file description]]). Unzip this, probably in the same place you&#039;ve unzipped the [[KnotTheory`]] package. This will create a subdirectory called WikiLink, containing (at least) these files:&lt;br /&gt;
{| border=1&lt;br /&gt;
|-&lt;br /&gt;
!Filename&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica notebook containing wrapper function definitions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;WikiLink.m&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The Mathematica package automatically generated from &amp;lt;tt&amp;gt;WikiLink.nb&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The WikiLink java class and source code ([[MediawikiConnection.java]]).&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;tt&amp;gt;jdom.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-httpclient-3.0-rc2.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-codec-1.3.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-lang-2.1.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;commons-logging.jar&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
| Libraries (all available under either GPL or the Apache license) required by &amp;lt;tt&amp;gt;wikilink.jar&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Importing the package in Mathematica====&lt;br /&gt;
First, you&#039;ll need to set some paths, so WikiLink` can find the java files it needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--$$KnotAtlasPath = &amp;quot;c:\\scott\\math.berkeley.edu\\Work\\Mathematica\\KnotAtlas\\&amp;quot;;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 1 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;KnotAtlasPath = &amp;quot;c:\\scott\\math.berkeley.edu\\Work\\Mathematica\\KnotAtlas\\&amp;quot;;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$AppendTo[$Path, KnotAtlasPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 2 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;AppendTo[$Path, KnotAtlasPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$SetDirectory[KnotAtlasPath];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 3 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;SetDirectory[KnotAtlasPath];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$&amp;lt;&amp;lt; &amp;quot;WikiLink\\WikiLink.m&amp;quot;$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 4 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt; &amp;quot;WikiLink\\WikiLink.m&amp;quot;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$SetJarPath[KnotAtlasPath &amp;lt;&amp;gt; &amp;quot;WikiLink\\&amp;quot;];$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 5 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;SetJarPath[KnotAtlasPath &amp;lt;&amp;gt; &amp;quot;WikiLink\\&amp;quot;];&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then try to connect to the wiki. Executing this line will prompt you for a username and password.&lt;br /&gt;
&amp;lt;!--$$CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  wikiUserName=InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password&amp;quot;]&lt;br /&gt;
  ]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{In|&lt;br /&gt;
n  = 6 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;CreateWikiConnection[&lt;br /&gt;
  &amp;quot;http://katlas.math.toronto.edu/w/index.php&amp;quot;,&lt;br /&gt;
  wikiUserName=InputString[&amp;quot;Enter Your Username:&amp;quot;],&lt;br /&gt;
  InputString[&amp;quot;Enter Your Password&amp;quot;]&lt;br /&gt;
  ]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;WikiUserName[]&amp;lt;/code&amp;gt; checks that we&#039;re logged in&lt;br /&gt;
&amp;lt;!--$$?WikiUserName$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{HelpLine|&lt;br /&gt;
n  = 7 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;WikiUserName&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;WikiUserName[] returns either the name of the user you are logged in as, or $Failed if you appear to be not logged in.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&amp;lt;!--$$wikiUserName==WikiUserName[]$$--&amp;gt;&lt;br /&gt;
&amp;lt;!--Robot Land, no human edits to &amp;quot;END&amp;quot;--&amp;gt;&lt;br /&gt;
{{InOut|&lt;br /&gt;
n  = 8 |&lt;br /&gt;
in = &amp;lt;nowiki&amp;gt;wikiUserName==WikiUserName[]&amp;lt;/nowiki&amp;gt; |&lt;br /&gt;
out= &amp;lt;nowiki&amp;gt;True&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;!--END--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
&lt;br /&gt;
====Compatibility====&lt;br /&gt;
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=Who_Am_I&amp;diff=41828</id>
		<title>Who Am I</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=Who_Am_I&amp;diff=41828"/>
		<updated>2005-08-31T18:55:15Z</updated>

		<summary type="html">&lt;p&gt;ScottManualRobot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[User:ScottManualRobot|ScottManualRobot]]&lt;/div&gt;</summary>
		<author><name>ScottManualRobot</name></author>
	</entry>
</feed>