User:Darija Medic/technicalcourse/epub

From XPUB & Lens-Based wiki
< User:Darija Medic‎ | technicalcourse
Revision as of 21:34, 23 September 2010 by Migratebot (talk | contribs) (Created page with " Epub consists of one feed for the titles, and a second for the chapters. <source lang="python"> import feedparser import pprint import sys pull = feedparser.parse("http:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Epub consists of one feed for the titles, and a second for the chapters.

import feedparser
import pprint
import sys

pull = feedparser.parse("http://xkcd.com/rss.xml")
pull1 = feedparser.parse("http://rss.allrecipes.com/daily.aspx?hubID=80")
print """
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Feeder</title>
    <link type="text/css" rel="stylesheet" media="all" href="stylesheet.css" />
  </head>
  <body>"""
for i in pull.entries:
    print "<h1>"
    print i["title"].replace("&", "&amp;").encode("utf-8")
    print"</h1>"
    for e in pull1.entries:
        print"<p>"
        print e["summary"].replace("&", "&amp;").encode("utf-8")
        print "</p>"

print  """
</body>
</html>"""
sys.exit()


Attachments