News for hackers. Stuff that matters.
Re:101 Zen Stories by heyitsnick on Monday April 12, 2010 @08:38AM (#1258982)
Well if you fancied this on your ebook reader, this new site makes it easier to do something like...

    with open(r"zen.html", "w") as f:
        pat = re.compile(r'.*\<p class="header"\>(.*?)</p>.*!-- Display story -->(.*?)</div>', re.DOTALL)
        for i in range(101):
            url = "http://www.101zenstories.com/index.php?story=%s" % str(i + 1)
            html = urlopen(url).read()
            result = pat.match(html)
            f.writelines(["<h2>%d. %s</h2>" % (i + 1, result.group(1)), result.group(2)])

There are no comments on this comment yet.