Still on the heels of the my project to create a free Philippine law database :-) I started with the name LEX LIBERA, but realized sooner that there might be potential conflict with the established LEX LIBRIS from CD Asia Technologies. So I decided to change the name from LEX LIBERA to The Free Law Project and transferred the files from wiki-site.com (which does not allow free backing up files) to my own subdomain at 110mb.com (http://islesv.110mb.com). I also learned about PmWiki, which uses flat files and therefore does not require MySQL (which I am unwilling and unable to pay).
After I reviewed 110mb.com's Terms of Use, I realized that I could in fact create another account, so I created an account for Free Law, downloaded the Free Law files from islesv.110mb.com via FTP, and uploaded them to freelaw.110mb.com. Everything except the most important bits: the contents of wiki.d itself. 110mb.com does not allow uploading of files with unregistered extensions.
I could not just upload all those files one-by-one manually. There are almost a hundred of them. So I tried to create a Python script. I disabled the password protection to the site to make it simpler. Here is the script:
UPDATE: I am investigating PmWiki's ImportText recipe to check if I can make use of it.
Like this post? Please help me pay for my Internet access.
Labels: Projects, Websites
After I reviewed 110mb.com's Terms of Use, I realized that I could in fact create another account, so I created an account for Free Law, downloaded the Free Law files from islesv.110mb.com via FTP, and uploaded them to freelaw.110mb.com. Everything except the most important bits: the contents of wiki.d itself. 110mb.com does not allow uploading of files with unregistered extensions.
I could not just upload all those files one-by-one manually. There are almost a hundred of them. So I tried to create a Python script. I disabled the password protection to the site to make it simpler. Here is the script:
import os, reI tried firing the script at 110mb.com only to realize that I receive "Connection refused" errors. Bummer.
from urllib2 import *
from ClientForm import ParseResponse
dirlist = os.listdir("wiki.d")
for fname in dirlist:
f = open("wiki.d/" + fname)
t = f.read()
l = re.search("text=([^$]*?)time=", t)
wikitext = unquote(l.group(1))
print wikitext
url = "http://path/to/my/wiki/" + fname + "?action=edit"
response = urlopen(url)
forms = ParseResponse(response)
form = forms[1]
form["text"] = wikitext
urlopen(form.click())
UPDATE: I am investigating PmWiki's ImportText recipe to check if I can make use of it.
Like this post? Please help me pay for my Internet access.
Labels: Projects, Websites

