added notification
This commit is contained in:
+8
-2
@@ -1,8 +1,11 @@
|
|||||||
import requests
|
|
||||||
import bs4
|
import bs4
|
||||||
import configparser
|
import configparser
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import mechanize
|
import mechanize
|
||||||
|
import pushover
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
pushover.init('a5uja274ec5h46paanzjqy5zo1ym6y')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
br = mechanize.Browser()
|
br = mechanize.Browser()
|
||||||
@@ -19,8 +22,11 @@ def main():
|
|||||||
table = lentlist.select('table[class="rTable_table"]')[0]
|
table = lentlist.select('table[class="rTable_table"]')[0]
|
||||||
for entry in table.tbody.select('tr'):
|
for entry in table.tbody.select('tr'):
|
||||||
info = list(map(lambda x: str(x.text).strip(), entry.select('td')))
|
info = list(map(lambda x: str(x.text).strip(), entry.select('td')))
|
||||||
|
date = datetime.datetime.strptime(info[1], '%d.%m.%Y')
|
||||||
|
delta = date - datetime.datetime.now()
|
||||||
|
|
||||||
|
if delta.days <= 10 or delta.days == 20 or delta.days == 15:
|
||||||
|
pushover.Client('u5w9h8gc7hpzvr5a2kh2xh4m9zpidq').send_message('Bitte an {} denken, Abgabe {}'.format(info[3], info[1]), title="Erinnerung")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user