aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/track_online.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-07-17 20:20:10 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-07-17 20:20:10 +0300
commita320153d3ee820434fc390029328b853e3434fc6 (patch)
treeed9a3ca1866a2ea9203857a4f43e1d3ac60d3776 /track_online.py
parentREADME update (diff)
downloadvk-scripts-a320153d3ee820434fc390029328b853e3434fc6.tar.gz
vk-scripts-a320153d3ee820434fc390029328b853e3434fc6.zip
bugfix
Diffstat (limited to '')
-rw-r--r--track_online.py10
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))