Permalink
Browse files

Check if the calendar url link is "hidden"

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 c12f11b321fddcae28cc8abe57035173a5c19799
Showing with 7 additions and 0 deletions.
  1. +7 −0 telegramschoolbot/tasks.py
@@ -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

0 comments on commit c12f11b

Please sign in to comment.