From Bauman National Library
This page was last modified on 20 June 2017, at 15:41.
Developer(s) Mathieu Blondel
Introduced 11 июнь 2006
Data deduplication (single_instance_storage)
Supported operating systems Mac OS X, Linux, FreeBSD

WikipediaFS is a mountable Linux virtual file system that allows to read and edit articles from Wikipedia (or any Mediawiki-based site) as if they were real files.

It is thus possible to view and edit articles using your favourite text-editor. Text-editors tend to be more convenient than a simple browser form when it comes to editing large texts and they generally include useful features such as Mediawiki syntax highlighting and spell checking.

Work on the project suspended from 2007

Installation and first start

Command to install the package:

%# apt-get install wikipediafs

This package will be installed automatic with first one:

  • libfuse2
  • fuse-utils
  • python-fuse

After installation you will be able to make first start :

%$ mount.wikipediafs 
fuse: missing mountpoint
filesystem initialization failed

Despite of error,programm have made a configuration file, so we need to change it and specify the connection settings for the wiki-media site.

igor@chub:~$ ls /home/igor/.wikipediafs/
config.xml  wikipediafs.log

For example, to work with configuration file will look like:

<?xml version="1.0" encoding="UTF-8"?>

To connect, instead of words user and password, you should enter your login and password.

Example of use

To start using wiki from user,you need to include into the group

fuse and relog.
   %$ sudo useradd -a -G fuse user

After it you will be able to use wiki as file system.

   $ mount.wikipediafs /mnt/wfs/
   $ ls /mnt/wfs/
   $ cd /mnt/wfs/

It's empty,because we have not accessed a single file yet.


   $ cat | less

Now you can see code of this page.

Try to change it:

   $ vi

Page will be changed.

Automation of work

If the wiki project is not very large, then you can pull the names of all his pages with the help of a small script:
wget -O - 'http://'$SITE$INDEX'?title=Special:Popularpages&limit=1000&offset=0' 2>/dev/null \
| grep '' \
| perl -p -e 's@.*?/wiki/@@; s@".*@@' \
| perl -p -e 's/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg;'

There are a couple of options for how to do that in the directory appeared the first 100 pages:

wpfs-all-pages \
| head -100 \
| grep -v / \
| while read name 
    head -1 wfs/$ > /dev/null 
    echo $name 

set -x

cat $filename >/tmp/wpfs-perl-i-$$
cat /tmp/wpfs-perl-i-$$ | perl -i "$@" > $filename
rm /tmp/wpfs-perl-i-$$
 for i in *.mw ; do wpfs-perl-i $i -p -e "s@Short link:[^'< \n]*)@{{short|\$1}}@"  ; done