File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 4
4
"""
5
5
import requests
6
6
from covid import Covid
7
- from os import *
8
7
9
8
previous_data = []
10
9
# #######################Telegram###########################
@@ -14,14 +13,9 @@ def send_msg(text):
14
13
token = "YOUR-TOKEN-HERE"
15
14
chat_id = "GROUP-CHAT-ID-HERE"
16
15
url_req = (
17
- "https://api.telegram.org/bot" +
18
- token +
19
- "/sendMessage" +
20
- "?chat_id=" +
21
- chat_id +
22
- "&text=" +
23
- text
24
- )
16
+ 'https://api.telegram.org/'
17
+ 'bot' + token + '/sendMessage' +
18
+ '?chat_id=' + chat_id + "&text=" + text )
25
19
results = requests .get (url_req )
26
20
print (results .json ())
27
21
@@ -34,9 +28,10 @@ def send_msg(text):
34
28
"{} : \t {}" .format (k , v )
35
29
for k , v in India_cases .items ()
36
30
if not k .startswith (("population" , "total" ))
37
- ) +
38
- "\n #IndiaFightsCorona"
31
+ )
32
+ + "\n #IndiaFightsCorona"
39
33
)
34
+
40
35
previous_data .append (stat )
41
36
while 1 :
42
37
covid = Covid (source = "worldometers" )
@@ -46,8 +41,8 @@ def send_msg(text):
46
41
"{} : \t {}" .format (k , v )
47
42
for k , v in India_cases .items ()
48
43
if not k .startswith (("population" , "total" ))
49
- ) +
50
- "\n #IndiaFightsCorona"
44
+ )
45
+ + "\n #IndiaFightsCorona"
51
46
)
52
47
if stat in previous_data :
53
48
print ("Duplicate" )
You can’t perform that action at this time.
0 commit comments