Too many requests was causing Arch Linux news to break
This commit is contained in:
parent
a4568d42e2
commit
83ff957410
2 changed files with 5 additions and 1 deletions
|
@ -41,7 +41,7 @@ UPDATE_COLOR=#ffff85
|
|||
LABEL=
|
||||
|
||||
[arch_linux_news]
|
||||
interval=30
|
||||
interval=60
|
||||
|
||||
[temperature]
|
||||
label=<span foreground='#c7505c'> </span>
|
||||
|
|
|
@ -25,6 +25,10 @@ def main() -> None:
|
|||
|
||||
url = "https://www.archlinux.org/feeds/news/"
|
||||
feed = feedparser.parse(url)
|
||||
summary = feed["feed"].get("summary")
|
||||
if summary is not None and "too many requests" in summary.lower():
|
||||
print("Arch Linux news: too many requests")
|
||||
return
|
||||
latest_title = feed["entries"][0]["title"]
|
||||
latest_link = feed["entries"][0]["link"]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue