aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mutual_friends.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mutual_friends.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mutual_friends.py b/mutual_friends.py
index 7df408a..b0bf363 100644
--- a/mutual_friends.py
+++ b/mutual_friends.py
@@ -9,12 +9,12 @@ import json
import sys
import vk.api
-from vk.user import Field
+from vk.user import UserField
-def query_friend_list(api, user):
- return api.friends_get(user.get_uid(), fields=Field.SCREEN_NAME)
+OUTPUT_FIELDS = UserField.UID, UserField.FIRST_NAME, UserField.LAST_NAME, UserField.SCREEN_NAME
-OUTPUT_FIELDS = Field.UID, Field.FIRST_NAME, Field.LAST_NAME, Field.SCREEN_NAME
+def query_friend_list(api, user):
+ return api.friends_get(user.get_uid(), fields=OUTPUT_FIELDS)
def extract_output_fields(user):
new_user = OrderedDict()
@@ -67,7 +67,7 @@ if __name__ == '__main__':
args = parser.parse_args()
api = vk.api.API(vk.api.Language.EN)
- users = api.users_get(args.uids, fields=Field.SCREEN_NAME)
+ users = api.users_get(args.uids)
friend_lists = map(lambda user: frozenset(query_friend_list(api, user)), users)
mutual_friends = frozenset.intersection(*friend_lists)