SpecialPage to feed article text to shell script

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SpecialPage to feed article text to shell script

Michael Steidley
I have a wiki setup to archive text documents. I've got my importing
scripts working well but I need a way to export out the raw article text
and feed it to a shell script. It can be fed to it on standard input or
saved to a temporary file and the file name passed as an argument. What
I would eventually like to do is use a template to create a link to the
special page to easily feed it the page name to be processed. My PHP
programming experience is a little limited. Could someone help me at
least get a working framework? Any input would be greatly appreciated.
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: SpecialPage to feed article text to shell script

Tim Doyle-2
You could use the 'raw' view of an article to easily grab the contents of
the page like this:

/index.php?title=your_title&action=raw

I'd just write a quick perl script to do a web query using an URL similar to
the above and feed it to your script.

Tim


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Michael Steidley
Sent: Saturday, February 18, 2006 1:10 PM
To: [hidden email]
Subject: [Mediawiki-l] SpecialPage to feed article text to shell script


I have a wiki setup to archive text documents. I've got my importing
scripts working well but I need a way to export out the raw article text
and feed it to a shell script. It can be fed to it on standard input or
saved to a temporary file and the file name passed as an argument. What
I would eventually like to do is use a template to create a link to the
special page to easily feed it the page name to be processed. My PHP
programming experience is a little limited. Could someone help me at
least get a working framework? Any input would be greatly appreciated.
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: SpecialPage to feed article text to shell script

Jan Steinman
In reply to this post by Michael Steidley
> I need a way to export out the raw article text
> and feed it to a shell script... My PHP
> programming experience is a little limited.

     http://us3.php.net/manual/en/ref.exec.php

Beware of script injection hacks. If you do this on pages that are  
open to arbitrary editing, some trickster could possibly delete any  
file that your web server effective user ID has permission to delete,  
or cause no end of other trouble.


:::: Trusting to escape scrutiny, by fixing the public gaze upon the  
exceeding brightness of military glory -- that attractive rainbow,  
that rises in showers of blood -- that serpent's eye, that charms to  
destroy -- he plunged into war -- Abraham Lincoln on President Polk ::::
:::: Jan Steinman http://www.EcoReality.org ::::





_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l