Skip to content

Commit

Permalink
Importing a script to download the text from the wiki, and also impor…
Browse files Browse the repository at this point in the history
…ting the SVG source of the logo (use Inkscape to view)
  • Loading branch information
baoilleach committed Aug 29, 2006
1 parent 51fb3d7 commit 9f4a462
Show file tree
Hide file tree
Showing 2 changed files with 526 additions and 0 deletions.
21 changes: 21 additions & 0 deletions downloadwiki.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import urllib
from BeautifulSoup import BeautifulSoup

wiki = "http://cclib.sourceforge.net/wiki"
# http://openbabel.sourceforge.net/w/index.php?title=Special:Export&action=submit&pages=FAQ
allpages = urllib.urlopen(wiki + "/index.php/Special:Allpages")

soup = BeautifulSoup(allpages)

hrefs = []
for anchor in soup('table')[2]('a'):
hrefs.append(anchor['href'].split("/")[-1])
print hrefs

params = urllib.urlencode({"action":"submit",
"pages":"\n".join(hrefs)})

query = urllib.urlopen(wiki + "/index.php/Special:Export", params)
outputfile = open("backup.xml","w")
print >> outputfile, query.read()
outputfile.close()
Loading

0 comments on commit 9f4a462

Please sign in to comment.