This is a reusable plain version the varia library website. You can host your own website of books using just a simple csv file
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from feedparser import parse
|
|
|
|
from csvparser.csvparser import getfieldsofinterest, getfullpublication
|
|
|
|
|
|
|
|
feed = parse("http://varia.zone/en/feeds/all-en.rss.xml")
|
|
|
|
|
|
|
|
|
|
|
|
def getentries():
|
|
|
|
entries = {}
|
|
|
|
for entry in feed.entries:
|
|
|
|
if "Read & Repair" in entry.title:
|
|
|
|
entries[entry.title] = entry.description
|
|
|
|
return entries
|
|
|
|
|
|
|
|
|
|
|
|
def gettitles():
|
|
|
|
titles = []
|
|
|
|
for entry in feed.entries:
|
|
|
|
if "Read & Repair" in entry.title:
|
|
|
|
titles.append(entry.title)
|
|
|
|
return titles
|
|
|
|
|
|
|
|
|
|
|
|
def rabbithole():
|
|
|
|
entries = getentries()
|
|
|
|
fieldsofinterest = getfieldsofinterest()
|
|
|
|
for title, entry in entries.items():
|
|
|
|
entry = entry.lower()
|
|
|
|
for id, fields in fieldsofinterest.items():
|
|
|
|
if [f for f in fields if(f.lower() in entry)]:
|
|
|
|
publicationinfo = getfullpublication(id)
|
|
|
|
pubtitle = publicationinfo["Title"]
|
|
|
|
print(
|
|
|
|
"After {0} we recommend reading {1}".format(
|
|
|
|
title,
|
|
|
|
pubtitle)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
print(rabbithole())
|