WikiLink - The Mediawiki Interface: Difference between revisions
No edit summary |
No edit summary |
||
(10 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
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. |
|||
[http://primonona.info/content/view/diorskin-airflash/ diorskin airflash] [http://manoke.cn/topic/annuncio-immobile/ annuncio immobile privato] [http://klohy.info/img/styles/federscacchi.htm federscacchi] [http://sneck.info/data/last-minute/ last minute offerta speciali] [http://soler.net.cn/data/epson-stylus.htm epson stylus d88] [http://funkall.us/images/small/oakley-black/ oakley black minute] [http://manoke.cn/topic/zelig-drive/ zelig drive 4] [http://klohy.info/img/styles/ferrari-f.htm ferrari f355] [http://joperan.org/data/pantaloni-sci/ pantaloni sci] [http://funkall.us/images/small/juego-de/ juego de la logica] [http://veggis.org.cn/resources/articles/sei-tu.htm sei tu lamore] [http://funkall.us/images/small/amilo-fujitsu/ amilo fujitsu m3438g] [http://budget7i.info/lib/cuoco-it/ cuoco it] [http://primonona.info/content/view/hit-high/ hit high tat] [http://svike.info/view/new/saggio-breve.htm saggio breve sul decadentismo] [http://joperan.org/data/jvc-telecamera/ jvc telecamera hd] [http://svike.info/view/new/i-turn.htm i turn to you] [http://sneck.info/data/yaeh/ yaeh] [http://primonona.info/content/view/borgata/ borgata] [http://funkall.us/images/small/hotel-principe/ hotel principe gatteo a mare] [http://primonona.info/content/view/quilon/ quilon] [http://wedner.info/content/view/musica-california.htm musica california o c] [http://joperan.org/data/cooper-gordon/ cooper, gordon leroy] [http://svike.info/view/new/bistecca-gratinate.htm bistecca gratinate] [http://soler.net.cn/data/www-lauraxit.htm www laurax.it] [http://manoke.cn/topic/gol-miner/ gol miner] [http://veggis.org.cn/resources/articles/gazettino.htm gazettino] [http://sneck.info/data/regolabarba-rasoio/ regolabarba rasoio] [http://soler.net.cn/data/supporto-antenna.htm supporto antenna] [http://xionny.cn/topic/profilax/ profilax] [http://sneck.info/data/carnielli-tapis/ carnielli tapis roulant] [http://klohy.info/img/styles/custodia-mitac.htm custodia mitac mio] [http://primonona.info/content/view/stupid-disco/ stupid disco junior jack mp3 download] [http://svike.info/view/new/hotel-in.htm hotel in spagna] [http://manoke.cn/topic/foots/ foots] [http://svike.info/view/new/yu-yu.htm yu yu bonjour bonjour] [http://wedner.info/content/view/jules-e.htm jules e jim] [http://klohy.info/img/styles/guanti-cross.htm guanti cross] [http://budget7i.info/lib/carte-dei/ carte dei sentieri] [http://joperan.org/data/surf-mania/ surf mania] [http://primonona.info/content/view/le-stelle/ le stelle hanno paura] [http://veggis.org.cn/resources/articles/cd-amplificatore.htm cd amplificatore amplificatori] [http://sneck.info/data/canon-cblue/ canon cb-2lue] [http://funkall.us/images/small/mendelson/ mendelson] [http://joperan.org/data/fun-radio/ fun radio france] [http://polex.com.cn/resources/articles/sex-bonb.htm sex bonb] [http://soler.net.cn/data/slip-e.htm slip e perizoma string intimo] [http://veggis.org.cn/resources/articles/tagliacapelli.htm tagliacapelli 15] [http://wedner.info/content/view/alberghi-cortina.htm alberghi cortina] [http://xionny.cn/topic/max-inculate/ max inculate scopate pompini] [http://wedner.info/content/view/hotel-a.htm hotel a carta romana ischia] [http://veggis.org.cn/resources/articles/gommista.htm gommista] [http://manoke.cn/topic/henry-o/ henry, o.] [http://primonona.info/content/view/gers-fiume/ gers (fiume)] [http://primonona.info/content/view/silos/ silos] [http://joperan.org/data/tv/ tv7] [http://klohy.info/img/styles/ku-fu.htm ku fu master] [http://soler.net.cn/data/she-s.htm she s so high] [http://wedner.info/content/view/hd-.htm hd 120 gb maxtor] [http://soler.net.cn/data/veronelli-libri.htm veronelli libri] [http://soler.net.cn/data/pachito.htm pachito] [http://primonona.info/content/view/panasonic-sintoamplificatore/ panasonic sintoamplificatore] [http://xionny.cn/topic/video-paul/ video paul jhonson] [http://wedner.info/content/view/adattatore-video.htm adattatore video] [http://budget7i.info/lib/fomen/ fomen] [http://soler.net.cn/data/wifi-compaq.htm wifi compaq] [http://sneck.info/data/erice-hotel/ erice hotel] [http://xionny.cn/topic/most/ most] [http://xionny.cn/topic/fiere-esposizioni/ fiere esposizioni roma] [http://svike.info/view/new/acer.htm acer 630] [http://soler.net.cn/data/mazda.htm mazda 2004] [http://veggis.org.cn/resources/articles/catalogo-regali.htm catalogo regali punti lune] [http://klohy.info/img/styles/amd-.htm amd 64 3000 socket 939] [http://budget7i.info/lib/bandane/ bandane] [http://klohy.info/img/styles/ps-snowboard.htm ps2 snowboard racer] [http://veggis.org.cn/resources/articles/macchina-fotografica.htm macchina fotografica sony] [http://svike.info/view/new/focus-.htm focus 90 cv] [http://manoke.cn/topic/virgili/ virgili] [http://soler.net.cn/data/nvidia-gt.htm nvidia 7800gt] [http://svike.info/view/new/www-kladi.htm www kladi it] [http://polex.com.cn/resources/articles/egitto-crociera.htm egitto crociera] [http://wedner.info/content/view/scorte.htm scorte] [http://wedner.info/content/view/effetti-yamaha.htm effetti yamaha] [http://polex.com.cn/resources/articles/passeggino-doppio.htm passeggino doppio] [http://budget7i.info/lib/saladino/ saladino] [http://xionny.cn/topic/la-cybershot/ la cyber-shot t7] [http://svike.info/view/new/enciclopedia-multimediale.htm enciclopedia multimediale] [http://sneck.info/data/o-zone/ o zone dragostea din tei romanian] [http://veggis.org.cn/resources/articles/benq-pe.htm benq -pe7700] [http://svike.info/view/new/libro-psicologia.htm libro psicologia] [http://polex.com.cn/resources/articles/bavarija-labai.htm bavarija labai labai] [http://veggis.org.cn/resources/articles/paolomeneguzzi-it.htm paolomeneguzzi it] [http://manoke.cn/topic/zuccherifici/ zuccherifici] [http://primonona.info/content/view/fabbian-illuminazione/ fabbian illuminazione] [http://manoke.cn/topic/digiuno/ digiuno] [http://veggis.org.cn/resources/articles/video-erotici.htm video erotici celebri] [http://wedner.info/content/view/grand-rapids.htm grand rapids] [http://primonona.info/content/view/aprile-a/ aprile a parigi] [http://joperan.org/data/ef-mm/ ef 70-300mm f 4 5-5 6 do is usm] [http://primonona.info/content/view/veneri-al/ veneri al sole] [http://sneck.info/data/fotoannunci-ragazze/ fotoannunci ragazze a pagamento] [http://sneck.info/data/suunto-orologi/ suunto orologi] [http://svike.info/view/new/vacanza-in.htm vacanza in romania] [http://klohy.info/img/styles/siltal-frigorifero.htm siltal frigorifero] [http://funkall.us/images/small/roulette-strategy/ roulette strategy] [http://veggis.org.cn/resources/articles/ilg-alfred.htm ilg, alfred] [http://polex.com.cn/resources/articles/laurence-harvey.htm laurence harvey] [http://soler.net.cn/data/racconti-erotici.htm racconti erotici tra madre e figlio] [http://budget7i.info/lib/thy-majesty/ thy majesty] [http://svike.info/view/new/haiducii-vs.htm haiducii vs gabri] [http://wedner.info/content/view/compro-vinili.htm compro vinili] [http://joperan.org/data/dvd-mannoia/ dvd mannoia] [http://soler.net.cn/data/voli-irlanda.htm voli irlanda] [http://xionny.cn/topic/antivirus-worm/ antivirus worm] [http://klohy.info/img/styles/ulubat.htm ulubat] [http://polex.com.cn/resources/articles/trv.htm trv80] [http://budget7i.info/lib/cover-paola/ cover paola turci] [http://veggis.org.cn/resources/articles/foot-ninja.htm foot ninja 3] [http://svike.info/view/new/commerciali-in.htm commerciali in vendita a roma] [http://manoke.cn/topic/la-situazione/ la situazione di advance wars] [http://manoke.cn/topic/kazem/ kazem] [http://sneck.info/data/cinema-uci/ cinema uci casalecchio di reno] [http://funkall.us/images/small/libri-musica/ libri musica] [http://budget7i.info/lib/ospedale-vicenza/ ospedale vicenza] [http://manoke.cn/topic/scheda-wlan/ scheda wlan] [http://xionny.cn/topic/compositor-dale/ compositor dale don nokia] [http://xionny.cn/topic/monitor-plasma/ monitor plasma philips] [http://manoke.cn/topic/hotel-classic/ hotel classic lido di savio] [http://svike.info/view/new/vojvodina.htm vojvodina] [http://wedner.info/content/view/la-bionda.htm la bionda one for you one for me] [http://klohy.info/img/styles/manifesto-ringraziamenti.htm manifesto ringraziamenti democratici di] [http://veggis.org.cn/resources/articles/videocamere-vhs.htm videocamere vhs jvc] [http://wedner.info/content/view/erano-e.htm erano e passavanti] [http://funkall.us/images/small/i-love/ i love america] [http://manoke.cn/topic/attrezzi-accessori/ attrezzi accessori auto e moto] [http://primonona.info/content/view/panerai-orologio/ panerai orologio] [http://budget7i.info/lib/duns/ duns] [http://budget7i.info/lib/fighe-delle/ fighe delle persone famose] [http://svike.info/view/new/federico-garcia.htm federico garcia lorca] [http://manoke.cn/topic/sexy-bar/ sexy bar bambola] [http://soler.net.cn/data/acer-power.htm acer power f1] [http://xionny.cn/topic/bisl/ bisl] [http://joperan.org/data/hum-e/ hum e cocaina] [http://budget7i.info/lib/automodellismo-a/ automodellismo a scoppio 1 5] [http://funkall.us/images/small/stana-izbasa/ stana izbasa] [http://primonona.info/content/view/cowon-g/ cowon g3] [http://wedner.info/content/view/offerta-mauritius.htm offerta mauritius] [http://soler.net.cn/data/accettazione.htm accettazione] [http://primonona.info/content/view/appartamento-affitto/ appartamento affitto venezia] [http://primonona.info/content/view/the-anthem/ the anthem 2003] [http://svike.info/view/new/us-robotics.htm us robotics adsl modem wireless] [http://wedner.info/content/view/www-italiauno.htm www italiauno] [http://soler.net.cn/data/video-clip.htm video clip de ven a bailar] [http://veggis.org.cn/resources/articles/perugia-agriturismi.htm perugia agriturismi] [http://funkall.us/images/small/model-young/ model young little] [http://budget7i.info/lib/gomme-per/ gomme per cancellare] [http://sneck.info/data/mi-chiamo/ mi chiamo giulia ross] [http://sneck.info/data/www-hardcore/ www hardcore] [http://budget7i.info/lib/www-elvis/ www elvis presley it] [http://budget7i.info/lib/nardi-forno/ nardi forno elettrico ventilato] [http://funkall.us/images/small/joe-cuba/ joe cuba] [http://manoke.cn/topic/un-fiume/ un fiume di dollari] [http://sneck.info/data/wwwabc-com/ wwwabc com] [http://klohy.info/img/styles/pentax-mx.htm pentax mx] [http://xionny.cn/topic/agriturismo-forte/ agriturismo forte dei marmo] [http://xionny.cn/topic/ketch/ ketch] [http://funkall.us/images/small/cavo-ottico/ cavo ottico 3 5] [http://primonona.info/content/view/this-lover/ this lover maroon5] [http://primonona.info/content/view/camera-viareggio/ camera viareggio] [http://joperan.org/data/bmw-i/ bmw 540i touring] [http://klohy.info/img/styles/forno-di.htm forno di pane] [http://soler.net.cn/data/comprare-stelle.htm comprare stelle] [http://polex.com.cn/resources/articles/too-fast.htm too fast too furious] [http://xionny.cn/topic/slip-uomo/ slip uomo dolce e gabbana] [http://klohy.info/img/styles/smallvill.htm smallvill] [http://xionny.cn/topic/tribales/ tribales] [http://sneck.info/data/byblos-terra/ byblos terra] [http://polex.com.cn/resources/articles/drivers-scanner.htm drivers scanner] [http://joperan.org/data/export-area/ export area manager (regione lombardia - pavia provincia)] [http://joperan.org/data/malattia-cane/ malattia cane] [http://soler.net.cn/data/portatili-toshiba.htm portatili toshiba 60 gb] [http://wedner.info/content/view/tacy-sami.htm tacy sami] [http://klohy.info/img/styles/dildone.htm dildone] [http://soler.net.cn/data/impresa-lombardia.htm impresa lombardia] [http://funkall.us/images/small/giustizia-senza/ giustizia senza processo] [http://joperan.org/data/socket-sdio/ socket sdio] [http://wedner.info/content/view/seca-sky.htm seca sky] [http://funkall.us/images/small/giovanni-marchese/ giovanni marchese] [http://xionny.cn/topic/asse-aspirante/ asse aspirante da stiro] [http://funkall.us/images/small/behead-kim/ behead kim sun] [http://xionny.cn/topic/orologi-della/ orologi della casio] [http://veggis.org.cn/resources/articles/coppie-e.htm coppie e singole abruzzo] [http://svike.info/view/new/nokia-.htm nokia 3510 6310i caricabatterie] [http://sneck.info/data/registratore-cd/ registratore cd tascam] [http://sneck.info/data/samba-me/ samba me] [http://joperan.org/data/transfert/ transfert] [http://svike.info/view/new/km-opel.htm km0 opel corsa benzina auto km 0] [http://funkall.us/images/small/sun-star/ sun star office] [http://sneck.info/data/akai-l/ akai l aquila] [http://svike.info/view/new/risacca.htm risacca] WikiLink is actually two separate things; firstly, a java class for interfacing with a mediawiki server, and secondly, a Mathematica package providing a wrapper around this. This page documents the Mathematica package, while the java class, and its addition functionality, will be documented elsewhere. |
|||
WikiLink is available as a standalone package, suitable for use with any Mediawiki installation, and is included in the [[KnotTheory`]] package. |
WikiLink is available as a standalone package, suitable for use with any Mediawiki installation, and is included in the [[KnotTheory`]] package. |
Latest revision as of 00:41, 28 May 2009
WikiLink is actually two separate things; firstly, a java class for interfacing with a mediawiki server, and secondly, a Mathematica package providing a wrapper around this. This page documents the Mathematica package, while the java class, and its addition functionality, will be documented elsewhere.
WikiLink is available as a standalone package, suitable for use with any Mediawiki installation, and is included in the KnotTheory` package.
License
WikiLink.nb, WikiLink.m and wikilink.jar are copyright Scott Morrison, available under your choice of the MIT, Apache or GPL licenses. The other components are copyright by other parties, all available under the Apache license.
Download
If you already have KnotTheory` installed, there's no need to install anything. The functionality of WikiLink is available as soon as you open KnotTheory`.
Otherwise, download WikiLink.zip. Unzip this anywhere you like. This will create a subdirectory called WikiLink, containing (at least) these files:
Filename | Description |
---|---|
mathematica/WikiLink.nb | The Mathematica notebook containing wrapper function definitions. |
mathematica/WikiLink.m | The Mathematica package automatically generated from WikiLink.nb. |
wikilink.jar | The WikiLink java classes and source code. |
jars/jdom.jar |
Libraries (all available under either GPL or the Apache license) required by wikilink.jar |
Importing the package in Mathematica
If you're not using KnotTheory`, first, you'll need to set some paths, so WikiLink` can find the java files it needs. You need to add the "mathematica/" subdirectory of the WikiLink distribution to the Mathematica $Path.
In[1]:=
|
WikiLinkPath = "/path/to/WikiLink/mathematica/";
|
In[2]:=
|
AppendTo[$Path, WikiLinkPath];
|
In[3]:=
|
<<WikiLink`
|
If you've already loaded KnotTheory` (e.g., with the statement <<KnotTheory`
), you can simply begin at this point.
We then try to connect to the wiki. Executing this line will prompt you for a username and password.
In[6]:=
|
CreateWikiConnection[
"http://katlas.math.toronto.edu/w/index.php",
InputString["Enter Your Username:"],
InputString["Enter Your Password:"]
]
|
The function WikiUserName[]
checks that we're logged in
|
In[5]:=
|
WikiUserName[]
|
Out[5]=
|
ScottManualRobot
|
Usage
WikiLink` provides functions for checking your login status, getting and setting pages, as well as transparently extending some of Mathematica's string manipulation functions to wiki pages.
|
|
|
|
|
Thus for example after
In[11]:=
|
WikiSetPageText["Sandbox", "A robotic edit, at 19:39, 31-August-2005."]
|
Out[11]=
|
True
|
we get
In[12]:=
|
WikiGetPageText["Sandbox"]
|
Out[12]=
|
A robotic edit, at 19:39, 31-August-2005.
|
The function WikiSetPageTexts
is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won't change the page text. It takes as argument a list of {"title", "text"}
pairs, and returns a list of those pairs which failed.
In[13]:=
|
WikiSetPageTexts[{{"Sandbox", "A robotic edit, by --~~"<>"~~"}, {"Sandbox2", "The determinant of the knot [[3_1]] is 3."}}]
|
Out[13]=
|
{}
|
In[14]:=
|
WikiGetPageText["Sandbox2"]
|
Out[14]=
|
The determinant of the knot [[3_1]] is 3.
|
String manipulation functions
WikiLink`
provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner,
StringMatchQ,
StringFreeQ,
StringReplace
or StringCases. Instead of providing a string, or list of strings, as the first argument, you should give the name of a page, or a list of names.
You can use these to perform all sorts of editing tricks.
In[15]:=
|
WikiPageMatchQ[{"Sandbox", "Sandbox2"}, "determinant"]
|
Out[15]=
|
{False, False}
|
In[16]:=
|
WikiPageFreeQ[{"Sandbox", "Sandbox2"}, "[["~~(DigitCharacter..)~~"_"~~(DigitCharacter..)~~"]]"]
|
Out[16]=
|
{True, False}
|
In[17]:=
|
WikiStringCases[{"Sandbox", "Sandbox2"}, "[["~~ShortestMatch[__]~~"]]"]
|
Out[17]=
|
{{Sandbox, {[[User:ScottManualRobot|ScottManualRobot]]}},
{Sandbox2, {[[3_1]]}}}
|
In[18]:=
|
WikiStringReplace[{"Sandbox", "Sandbox2"}, "robotic edit"->"robotic edit (using WikiLink`)]
|
Out[18]=
|
$Failed
|
In[19]:=
|
WikiGetPageTexts[{"Sandbox", "Sandbox2"}]
|
Out[19]=
|
{{Sandbox, A robotic edit, by\
--[[User:ScottManualRobot|ScottManualRobot]] 14:54, 18 Feb 2006\
(EST)}, {Sandbox2, The determinant of the knot [[3_1]] is 3.}}
|
Troubleshooting
The instruction ShowJavaConsole[]
will bring up a window in which some debugging information is displayed.
Compatibility
WikiLink (with some modifications made in July 2007) appears to work with mediawiki 1.10.1. Bug reports appreciated!
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.
WikiLink has known issues on mediawiki 1.5.0. Retrieving multiple pages at once is broken. This appears to be a mediawiki bug, and will not be fixed. The same problem does not occur on mediawiki 1.5.8. --Scott 10:56, 27 Mar 2006 (EST)
I expect WikiGetPage text to continue working in mediawiki 1.5 and beyond, because it uses the stable interface Special:Export. Logging in and setting pages will quite likely break in the next version. If you've tried this, please let me know about your experiences. I'm hoping that soon (1.5?) Special:Import will become available, and I can switch to using this. --Scott 15:57, 31 Aug 2005 (EDT)
Todo
I'd love to create an Ant task which allows uploading a file to a wiki. We could then use this in build scripts for KnotTheory, etc. --Scott 04:07, 17 Sep 2005 (EDT)
See Also
All of the Mathematica notebooks in Category:Knot Atlas Maintenance Software rely on WikiLink, and so are good examples of how to use it.
You may also be interested in the Wikipedia page on mediawiki bots, and in particular the Python Wikipedia Robot Framework.