Skip to content

Commit

Permalink
Fixed Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
viperadnan-git authored Apr 5, 2021
1 parent 6e3b549 commit 591c5b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
check_interval = int(os.environ.get("INTERVAL", 5))
max_instances = int(os.environ.get("MAX_INSTANCES", 5))

if db.get_link("feed_url") == None:
db.update_link("feed_url", "*")
if db.get_link(feed_url) == None:
db.update_link(feed_url, "*")

app = Client(":memory:", api_id=api_id, api_hash=api_hash, bot_token=bot_token)

def check_feed():
FEED = feedparser.parse(feed_url)
entry = FEED.entries[0]
if entry.id != db.get_link("feed_url"):
if entry.id != db.get_link(feed_url).link:
# ↓ Edit this message as your needs.
message = f"**{entry.title}**\n```{entry.link}```"
try:
app.send_message(log_channel, message)
db.update_link("feed_url", entry.id)
db.update_link(feed_url, entry.id)
except FloodWait as e:
print(f"FloodWait: {e.x} seconds")
sleep(e.x)
Expand All @@ -50,4 +50,4 @@ def check_feed():
scheduler = BackgroundScheduler()
scheduler.add_job(check_feed, "interval", seconds=check_interval, max_instances=max_instances)
scheduler.start()
app.run()
app.run()

0 comments on commit 591c5b9

Please sign in to comment.