Ivan Kudryakov commited on
Commit ·
fa4d520
1
Parent(s): c28d0d4
commit 1
Browse files31 unmodified lines32333435363738391 unmodified line414243444546474849505131 unmodified linesparams_for_users_get = {'user_ids': my_id,'access_token': access_token,'v': api_version}myFirstAndLastName = requests.get('https://api.vk.com/method/users.get', params=params_for_users_get)# print(myFirstAndLastName.text)params_for_friends_get = {'user_id': my_id,1 unmodified line'fields': 'sex','access_token': access_token,'v': api_version}r = requests.get('https://api.vk.com/method/friends.get', params=params_for_friends_get)if 'error' in r.json() and r.json()['error']['error_code'] == 30:print('This is private profile, sorry')exit()print(r.text)AllMyFriends = r.json()['response']['items']# print(AllMyFriends[0]['id'])31 unmodified lines3233343536373839404142434445464748491 unmodified line51525354555657585960616263646566676831 unmodified linesparams_for_users_get = {'user_ids': my_id,'access_token': access_token,'v': api_version}while True:myFirstAndLastName = requests.get('https://api.vk.com/method/users.get', params=params_for_users_get)if 'error' in myFirstAndLastName.json() and myFirstAndLastName.json()['error']['error_code'] == 30:st.write('This is private profile, sorry')exit()if 'error' in myFirstAndLastName.json() and myFirstAndLastName.json()['error']['error_code'] == 6:time.sleep(0.8)continueif 'error' in myFirstAndLastName.json():st.write('unexpected error')exit()break# print(myFirstAndLastName.text)params_for_friends_get = {'user_id': my_id,1 unmodified line'fields': 'sex','access_token': access_token,'v': api_version}while True:r = requests.get('https://api.vk.com/method/friends.get', params=params_for_friends_get)if 'error' in r.json() and r.json()['error']['error_code'] == 30:st.write('This is private profile, sorry')exit()if 'error' in r.json() and r.json()['error']['error_code'] == 6:time.sleep(0.8)continueif 'error' in r.json():st.write('unexpected error')exit()breakprint(r.text)AllMyFriends = r.json()['response']['items']# print(AllMyFriends[0]['id'])
app.py+24-7