Tuesday, November 22, 2011

das wiki == de filesystem

The libferris virtual filesystem gains another tentacle, this time being able to mount mediawiki sites. Some cool use cases right off the cuff:

To read a wiki page
$ fcat wiki://$server/mediawiki/index.php/SamplePage
To write to a wiki page:
$ date | ferris-redirect -T wiki://$server/mediawiki/index.php/Sampler22

For those who are unfamiliar, ferris-redirect takes its stdin and writes it to the file you name. The -T truncates the file first. So the above is sort of like " >| " from bash but you get to write from any application to any libferris filesystem without using FUSE.

To plomp an image up on mediawiki:
ferriscp -av /tmp/Apple.png wiki://$server/mediawiki/index.php/

Which is then available as:
http://$server/mediawiki/index.php/File:Apple.png

And perhaps the coolest little trick so far, which doesn't rely on FUSE or mounting and uses an unmodified vi binary:

$ fedit wiki://alkid/mediawiki/index.php/Sampler22
... modify the "file" ...
ZZ to write it back to the web.

Also, I have tramp hacks to allow this to work from emacs.

Of course, this all interacts with other things libferris can mount, so you can "cp" from your scanner or webcam right to a wiki page or grab text from a wiki and create a pdf or print it out directly.

Oh, and there are Fedora 16 packages now too on openSUSE build service. Just run the following to get it all onto your system.

# yum install libferris-suite