Skip to content
Create a gist now

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import re
import requests
html = requests.get('')
all_pages_table ='<table class="mw-allpages-table-chunk">(.*)</table>',
html.content, re.DOTALL).group()
titles = re.findall(r'title="([^"]*?)"', all_pages_table)
hrefs = re.findall(r'href="([^"]*?)"', all_pages_table)
print("Go to and export the following:")
#!/usr/bin/env ruby
require 'rubygems'
require 'hpricot'
require 'gollum'
require 'open-uri'
wiki ='')
doc = Hpricot(open(''))'/mediawiki/page').each do |el|
title ='title')'/', '-')
content ='text').inner_text
kind = :mediawiki
commit = { :message => "Import MediaWiki page #{title} into Gollum",
:name => 'Bradley M. Froehle',
:email => '' }
m = content.match(/^\s*<rst>(.*)<\/rst>\s*$/m)
if m
kind = :rest
content = m[1]
puts "Writing page #{title}"
wiki.write_page(title, kind, content, commit)
rescue Gollum::DuplicatePageError => e
p "Duplicate #{title}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.