Skip to content

Instantly share code, notes, and snippets.

@nicwest
Created December 7, 2012 14:37
Show Gist options
  • Save nicwest/4233641 to your computer and use it in GitHub Desktop.
Save nicwest/4233641 to your computer and use it in GitHub Desktop.
default cover generator
print "\tCover Image..."
picture_page = "http://stunjelly.com/cover/?" + urllib.urlencode({"title": bundle["name"], "author": bundle["author"]})
opener1 = urllib2.build_opener()
page1 = opener1.open(picture_page)
my_picture = page1.read()
filename_img = os.path.join(directory, "OEBPS", "Images", "stunjelly-cover.jpg")
fout = open(filename_img, "w+")
fout.write(my_picture)
fout.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment