Make it possible to directly run sub-libs (feeds, crawler, readabilite)
Run `python -im morss.feeds http://website.sample/rss.xml` and so on
This commit is contained in:
@@ -754,3 +754,10 @@ class ItemJSON(Item, ParserJSON):
|
||||
return
|
||||
|
||||
cur = cur[node]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from . import crawler
|
||||
|
||||
data, con, contenttype, encoding = crawler.adv_get(sys.argv[1] if len(sys.argv) > 1 else 'https://www.nytimes.com/', follow='rss')
|
||||
feed = parse(data, url=con.geturl(), mimetype=contenttype, encoding=encoding)
|
||||
|
Reference in New Issue
Block a user