Paul Graham’s Essays

Paul Graham’s Essays don’t show when they were written, so this one goes through all of the essays and finds out.

import feedparser
import re
import urllib

#Regular expression that looks for something like this: "March 2004"
date_search = re.compile('([A-Z][a-z]* 200[0-9])')

def open_url(url):
    response = urllib.urlopen(url)
    data =
    return data

rss_feed = feedparser.parse('')

for entry in rss_feed['entries']:
    print entry['title'],
    url = entry['link']
    page = open_url(url)
    dates = date_search.findall(page)
    if not dates:
        print 'Unknown'
        print dates[0]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s