All pastes #797775 Raw Edit

Something

public text v1 · immutable
#797775 ·published 2007-11-26 07:00 UTC
rendered paste body
class Explosm(Comic):
  def __init__(self):
    Comic.__init__(self, 'Cyanide and Happiness')

  def getImageURL(self):
    feed = urllib.urlopen("http://www.explosm.net/comic/")
    match = re.search('src=(?P<quote>[\'"])(?P<image>http://www.explosm.net/db/files/Comics/.*\.png)(?P=quote)', feed.read() )
    try:
      return match.group('image')
    except IndexError:
      return None