mirror of
https://github.com/serega404/VodokanalBot.git
synced 2025-04-21 06:20:46 +03:00
Добавил дату в базу данных для отправки одинаковых сообщений
close issue #1
This commit is contained in:
parent
758c090824
commit
edb51bb696
6
main.py
6
main.py
@ -41,7 +41,7 @@ for tag in soup.find_all('font', size='2', face='VERDANA'):
|
|||||||
date = tag.select_one('font:nth-of-type(1)').b.text
|
date = tag.select_one('font:nth-of-type(1)').b.text
|
||||||
if not(date.split('.')[0] == str(datetime.today().day).zfill(2) and date.split('.')[1] == str(datetime.today().month).zfill(2)):
|
if not(date.split('.')[0] == str(datetime.today().day).zfill(2) and date.split('.')[1] == str(datetime.today().month).zfill(2)):
|
||||||
continue
|
continue
|
||||||
elements.append(tag.select_one('font:nth-of-type(2)').text.replace('\n', ''))
|
elements.append(date + "$" + tag.select_one('font:nth-of-type(2)').text.replace('\n', ''))
|
||||||
|
|
||||||
if elements == []:
|
if elements == []:
|
||||||
print("No posts")
|
print("No posts")
|
||||||
@ -68,10 +68,10 @@ if db is not None:
|
|||||||
exit()
|
exit()
|
||||||
|
|
||||||
for i in diff:
|
for i in diff:
|
||||||
send_message(i)
|
send_message(i.split("$",1)[1])
|
||||||
else:
|
else:
|
||||||
for element in elements:
|
for element in elements:
|
||||||
send_message(element)
|
send_message(element.split("$",1)[1])
|
||||||
|
|
||||||
# Save database
|
# Save database
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user