crunk
4 years ago
11 changed files with 77 additions and 5 deletions
@ -0,0 +1,10 @@ |
|||
Metadata-Version: 1.0 |
|||
Name: library |
|||
Version: 1.0 |
|||
Summary: UNKNOWN |
|||
Home-page: UNKNOWN |
|||
Author: UNKNOWN |
|||
Author-email: UNKNOWN |
|||
License: UNKNOWN |
|||
Description: UNKNOWN |
|||
Platform: UNKNOWN |
@ -0,0 +1,5 @@ |
|||
setup.py |
|||
library.egg-info/PKG-INFO |
|||
library.egg-info/SOURCES.txt |
|||
library.egg-info/dependency_links.txt |
|||
library.egg-info/top_level.txt |
@ -0,0 +1 @@ |
|||
|
@ -0,0 +1 @@ |
|||
|
@ -0,0 +1,40 @@ |
|||
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(): |
|||
for id, fields in fieldsofinterest.items(): |
|||
if [f for f in fields if(f in entry)]: |
|||
publicationinfo = getfullpublication(id) |
|||
pubtitle = publicationinfo["Title"] |
|||
print( |
|||
"After {0} we recommend reading {1}".format( |
|||
title, |
|||
pubtitle) |
|||
) |
|||
|
|||
|
|||
print(rabbithole()) |
@ -0,0 +1,3 @@ |
|||
from setuptools import setup, find_packages |
|||
|
|||
setup(name='library', version='1.0', packages=find_packages()) |
Loading…
Reference in new issue