summaryrefslogtreecommitdiff
path: root/watchnews/fetch.py
diff options
context:
space:
mode:
Diffstat (limited to 'watchnews/fetch.py')
-rwxr-xr-xwatchnews/fetch.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/watchnews/fetch.py b/watchnews/fetch.py
index e6c5c39..c476be7 100755
--- a/watchnews/fetch.py
+++ b/watchnews/fetch.py
@@ -8,6 +8,20 @@ from newspaper.cleaners import DocumentCleaner
import logging
+def dump_paper(link):
+ paper = Article(link)
+ paper.download()
+ paper.parse()
+ print("""\
+Article Dump:
+Title: {title}
+Url: {url}
+Authors: {authors}
+Text: {text}
+-----
+
+""".format(**paper.__dict__))
+
def update(feed):
logging.info('Update %s', feed.url)
result = feedparser.parse(feed.url)