print "already at first comic"
return
print "got " + comicid + " as the one before current..."
- elif len(earliest) == 10:
+ elif len(str(earliest)) == 10:
# date id.
dt = string.split(earliest, "-")
d = datetime.date(int(dt[0]),int(dt[1]),int(dt[2]))
s = f.read()
f.close()
# This should be done with regex but...
- splt = string.split(s, "<h3>Image URL (for hotlinking/embedding): ", 1)
- splt2 = string.split(splt[1], "</h3>", 1)
- url = splt2[0]
- splt = string.split(splt[0], "<h1>", 1)
- splt = string.split(splt[1], "</h1>", 1)
-
+ splt = string.split(s, 'png" title="', 1)
+ splt = string.split(splt[1], '" alt="', 1)
title = splt[0]
+ splt = string.split(splt[1], "<h3>Image URL (for hotlinking/embedding): ", 1)
+ splt = string.split(splt[1], "</h3>", 1)
+ url = splt[0]
+
elif comic == 'sinfest':
s = f.read()
self.keypointer = 0
if len(self.active_comics) < 1:
self.active_comics = ['xkcd']
+
self.db = ComicDb(self.active_comics[self.keypointer])
self.comicname = comics[self.active_comics[self.keypointer]]['name']
self.set_name = "comicwidget"