@@ -18,11 +18,10 @@ def _read_config(config_file):
18
18
config_json = json .loads (open (config_file ).read ())
19
19
20
20
public_walls = config_json ['public_walls' ] if 'public_walls' in config_json else None
21
- private_walls = config_json ['private_walls' ] if 'private_walls' in config_json else None
22
21
bot_token = config_json ['telegram_bot_token' ]
23
22
user_ids = config_json ['user_ids' ]
24
23
access_token = config_json ['vk_access_token' ] if 'vk_access_token' in config_json else None
25
- return public_walls , private_walls , bot_token , user_ids , access_token
24
+ return public_walls , bot_token , user_ids , access_token
26
25
27
26
28
27
def main (argv ):
@@ -45,7 +44,7 @@ def main(argv):
45
44
config_file = realpath (args [0 ])
46
45
47
46
logfile = config_file .replace ('json' , 'log' )
48
- logging .basicConfig (format = '%(asctime)s %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s' , datefmt = '%m/%d/%Y %H:%M:%S %Z' , filename = logfile , level = logging .INFO )
47
+ logging .basicConfig (format = '%(asctime)s %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s' , datefmt = '%m/%d/%Y %H:%M:%S %Z' , filename = logfile , level = logging .WARNING )
49
48
logger = logging .getLogger ('vk_to_telegram' )
50
49
storagefile = config_file .replace ('json' , 'last_check' )
51
50
@@ -67,10 +66,10 @@ def main(argv):
67
66
68
67
try :
69
68
70
- public_walls , private_walls , bot_token , user_ids , access_token = _read_config (config_file )
69
+ public_walls , bot_token , user_ids , access_token = _read_config (config_file )
71
70
while True :
72
71
fetch_time = int (time .time ())
73
- posts = vk_fetcher .fetch (public_walls , private_walls , last_fetch_time , access_token )
72
+ posts = vk_fetcher .fetch (public_walls , last_fetch_time , access_token )
74
73
last_fetch_time = fetch_time
75
74
with open (storagefile , "w" ) as text_file :
76
75
text_file .write (str (fetch_time ) + "\n " )
0 commit comments