Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

Commit

Permalink
Check if the calendar url link is "hidden"
Browse files Browse the repository at this point in the history
For some reason they decided to hide old links instead of removing them, but the bot doesn't know the difference so it would never pick up the new calendar url.
Sometimes i think that they are fucking with us.
  • Loading branch information
paolobarbolini committed Oct 19, 2017
1 parent 30d4b9d commit c12f11b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions telegramschoolbot/tasks.py
Expand Up @@ -99,6 +99,13 @@ def query_calendar_article(self, url):
not lower_href.startswith("/weborario"):
continue

# For some reason they decided to hide old links
# instead of removing them, but the bot doesn't know the difference
# so it would never pick up the new calendar url
# Sometimes i think that they are fucking with us.
if len(link.getText()) < 3:
continue

calendar_url = urllib.parse.urljoin(url, href)
return calendar_url

Expand Down

0 comments on commit c12f11b

Please sign in to comment.