pip install git+https://github.com/radinplaid/pynewsreader.git
# Show help
pnr --help
# Add a feed
pnr add_feed https://rss.cbc.ca/lineup/world.xml
# Update feed(s)
pnr update
# Show entries
pnr show --limit 10
# Search entries
pnr search canada
The main interface for viewing the RSS feeds is the Flask web application, which can be lauched from the command line:
pnr-app --host 0.0.0.0 --port 5000
# Or
python3 -m pynewsreader.app --host 0.0.0.0 --port 5000
Import and initialize pnr object
from pynewsreader.core import Feed, PyNewsReader
pnr = PyNewsReader()
Add a feed, and use a custom name for it
myfeed = Feed(
url="https://www.thestar.com/content/thestar/feed.RSSManagerServlet.articles.topstories.rss",
name="Toronto Star | Top Stories",
)
pnr.add_feed(myfeed)
myfeed = Feed(
url="https://www.thebeaverton.com/feed/?q=1684448990",
name="The Beaverton",
)
pnr.add_feed(myfeed)
myfeed = Feed(
url="https://hf.co/blog/feed.xml",
name="Huggingface Blog",
)
pnr.add_feed(myfeed)
myfeed = Feed(
url="https://engineering.fb.com/feed",
name="Facebook AI Blog",
)
pnr.add_feed(myfeed)
myfeed = Feed(
url="https://ai.googleblog.com/atom.xml",
name="Google AI Blog",
)
pnr.add_feed(myfeed)
pnr.add_feed("https://proceedings.mlr.press/feed.xml")
pnr.add_feed("https://bair.berkeley.edu/blog/feed.xml")
pnr.add_feed("https://openai.com/blog/rss.xml")
pnr.add_feed("https://blogs.rstudio.com/ai/index.xml")
pnr.add_feed("https://www.jstatsoft.org/gateway/plugin/WebFeedGatewayPlugin/rss2")
Update feeds
pnr.update()
List entries
pnr.show(limit=1)
Search entries
pnr.search("inflation", limit=1)