It is very easy to use Wikipedia data with MoinMoin (not more difficult than with MediaWiki).
You can guess how flexible MoinMoin is - I wrote 30 lines of code (the database adapter) to pull the articles. Try that with any other Wiki.
the MediaWiki parser is not officially supported and will block some functionality like InterWiki linking and smileys in your wiki.
- What do you mean by "block" here?
How to set up such a wiki
Get MoinMoin 1.3 - at least 1.3.4
Apply the Virtual Pages patch from MoinMoinPatch
Install the MediaWiki parser (see ParserMarket or Merten-home.de)
Set it up as the default parser (see HelpOnConfiguration)
Install the Monobook theme (see ThemeMarket)
- Install MySQL and MySQLforPython
Load the official database dump into MySQL (see http://download.wikimedia.org/)
- If you want to speed up the import, replace all keys in the table definition by:
UNIQUE KEY `name_title_dup_prevention` (`cur_title`, `cur_namespace`)
- If you want to speed up the import, replace all keys in the table definition by:
Add 30 lines of code that access that database. You have to put it into data/plugin/virtual.
- dbadapter.py
1 import MySQLdb 2 import traceback, sets 3 4 regex = r".*" 5 dbpages = sets.Set() 6 hdpages = sets.Set() 7 8 conn = MySQLdb.connect(host = "localhost", user = "root", passwd = "", db = "wp") 9 10 def convPagename(pn): 11 return conn.escape(pn.encode("iso-8859-1", "replace").replace(" ", "_")) 12 13 def filter(pagename, mo): # set frontpage FIXME 14 if pagename in ("", "FrontPage", "StartSeite") or pagename in hdpages: 15 return False 16 if pagename in dbpages: 17 return True 18 cursor = conn.cursor() 19 rows = cursor.execute("SELECT 1 FROM cur WHERE cur_title = " + convPagename(pagename)) 20 cursor.close() 21 if (rows > 0): 22 dbpages.add(pagename) 23 return True 24 else: 25 hdpages.add(pagename) 26 return False 27 28 def execute(request, match): 29 print "Fetching " + request.page.page_name 30 #traceback.print_stack() 31 cursor = conn.cursor() 32 cursor.execute("SELECT cur_text FROM cur WHERE cur_title = " + convPagename(request.page.page_name)) 33 row = cursor.fetchone() 34 if row is not None: 35 text = row[0] 36 else: 37 text = "Page not found." 38 cursor.close() 39 return text
How big is it
- the English Wikipedia media data is 76GB
- texts are about 3 GB (all revisions)
for downloading also take a look on Wikipedia:Database_download for uptodate information.
Limitations
The main feature of MoinPedia is currently viewing pages. The following things do not work:
- Editing pages (Virtual pages plugin limitation)
Searching for text
Numerous markup things are not understood by the MediaWiki parser for MoinMoin
- Pages with particular Unicode pagenames cannot be accessed correctly if MySQL is not configured correctly
Discussion
- What about a solution that pulls the articles and puts them into Moin Wiki Pages?
- That won't work with the current storage system.
I thought a thing like this would bei nice: Put only this in a page: [[WikiPedia(MoinMoin Wiki)]] This should fetch the page and convert it into Moin Wiki code. So this could work together with InterWikI!
- Yeah, you could write a macro that fetches the page and outputs a link. The mediawiki parser will handle the markup then.
- That won't work with the current storage system.
- I suppose the patch does not work in 1.5 ? If we had (1.) we could make this version independend.
- It should work with minor changes.
- Does anybody have a Wikipedia mirror with Moin online? Could we link to it? -- Thilo