diff options
author | Michael Yick <cavemanon@mail.snootgame.xyz> | 2023-02-27 20:01:55 -0600 |
---|---|---|
committer | Michael Yick <cavemanon@mail.snootgame.xyz> | 2023-02-27 20:01:55 -0600 |
commit | 3215b065400d239b074d9206961616a6d3e376bb (patch) | |
tree | aa04bfdc953f8b64a6bda878babaa2b74746a8cb | |
parent | 96adb62ce1ab2f75d2b3f51ccad5ae69604c340b (diff) | |
download | dilbertRss-3215b065400d239b074d9206961616a6d3e376bb.tar.gz dilbertRss-3215b065400d239b074d9206961616a6d3e376bb.tar.bz2 dilbertRss-3215b065400d239b074d9206961616a6d3e376bb.zip |
-rw-r--r-- | README.md | 3 | ||||
-rwxr-xr-x | main.py | 9 |
2 files changed, 9 insertions, 3 deletions
@@ -2,6 +2,8 @@ run `uvicorn main:app --port 8866` in this directory to start the RSS feed reader. # Dependencies +This assumes you're using Debian bullseye. +``` python3 BeautifulSoup tor @@ -9,3 +11,4 @@ python3-feedgenerator python3-fastapi python3-requests python3-socks +``` @@ -32,9 +32,12 @@ async def root(): search = session.get("https://dilbert.com/strip/" + date) soup = bs4.BeautifulSoup(search.text, features="lxml") - comicTitle = soup.find("meta", property="og:title")["content"] - comicURL = soup.find("meta", property="og:image")["content"] - comicAuthor = soup.find("meta", property="article:author")["content"] + try: + comicTitle = soup.find("meta", property="og:title")["content"] + comicURL = soup.find("meta", property="og:image")["content"] + comicAuthor = soup.find("meta", property="article:author")["content"] + except: + continue url = "https://dilbert.com/strip/" + date sneed.add_item( title=comicTitle, description=comicURL, author_name=comicAuthor, link=url, id=id) |