views:

247

answers:

3

I am building an iPhone Wikipeida game app, that requires modifying the default Wiki HTML a little bit (mostly simplifying the page).

So far I am directly downloading the HTML output from en.wikipedia.org/wiki/Article_Foo to a python Google App Engine, and then modify its CSS and HTML structure, cache it, and finally output to iPhone. It works but I find this method quite tedious, there must be a better method?

Please note that I use App Engine not just for parsing the Wiki, but the game also requires it to keep the stores...etc, hence not a overkill. Also, I would prefer doing all the work with python on App Engine, to keep the iPhone client as thin and mobile as possible (XML on iPhone is a big no fun)

Thanks a lot.

=======

Nick mentions why not use the mobile Wiki which already optimizes for iPhone. However, the issue is that it goes down quite frequently (every couple weeks or so), also its HTML structure changes quite frequently too.

+2  A: 

You can use the MediaWiki API to download the markup text and use some API tools for Python that could make the process/modify work easier.

Caching and outputting to iPhone is fine. I believe there is not much to simplify here.

jbochi
+1 for using existing libraries. I have used mwclient with great success.
kigurai
A: 

Why not just fetch the mobile version of the page from http://en.m.wikipedia.org/? This is already formatted for mobile devices.

Nick Johnson
That's what I have been doing all along. But that site is always down (every couple weeks or so). And its HTML structure changes from time to time too : (
ivanTheTerrible
A: 

You can set up your own copy of the server used by m.wikimedia.org:

http://github.com/hcatlin/wikimedia-mobile

It's written in Ruby, but this shouldn't be an issue if your app just uses the HTML output.

jpatokal