diff options
Diffstat (limited to 'track_online.py')
-rw-r--r-- | track_online.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/track_online.py b/track_online.py index c1bae37..7a4085d 100644 --- a/track_online.py +++ b/track_online.py @@ -4,12 +4,18 @@ from datetime import datetime import time +import sys import api def users_get(user_ids): - return api.users_get(user_ids=','.join(user_ids), - fields='online,last_seen') + response = api.users_get(user_ids=','.join(user_ids), + fields='online,last_seen') + if len(response) < len(user_ids): + print('Error: couldn\'t find at least one of the users!', + file=sys.stderr) + sys.exit(1) + return response def log(s): print('[{}] {}'.format(datetime.now().replace(microsecond=0), s)) |