You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task: Download last the biggest size photos from member of social network vk.com (<be> in touch) and upload them to Yandex Disk or Google Drive new folder.
Description: the template of file name is <count_of_likes>.<ext>. If the same number of likes are found, download date must be added to the file names. Also need to write a json file with file upload information (file name and image size). The new Yandex Disk/Google Drive folder's template is "img_from_vk_id<VK_user_id>_dt<current datetime in YYYYMMDDHHMISS format>"
Warning! Task was changed: it is possible situation when photos uploaded at the same date and had the same count of likes. At this case adding upload date will cause an error, so I add upload datetime.
Class VKUser
Description:
Method
Parameters
Return type
Description
__init__
user_id:int
-
Second method during Class creation
__str__
-
str
string representation of the Class - link to the homepage of user
print_user_id
user_id=None:int
-
print user id with user = user_id (or current user if user_id is None)
get_user_info
user_id=None:int
json of VK.users.get
get user description with with user = user_id (or current user if user_id is None)
print_user_info
user_id=None:int
-
print user information with user = user_id (or current user if user_id is None) <user_id>: <first_name> <last_name>
get_friends
user_id=None:int
set of VK id
return set with friends id of user = user_id (or current user if user_id is None)
__and__
other_VK_user:VKUser
list of VKUser objects
overriding the "&" method. Method returns a list of class' objects referring to mutual friends current user and other_VK_user
Введите id пользователя Вконтакте: 35163310
Введите токен Яндекса: ********
Вконтакте: получены последние 5 фотографий
Я.Диск: создана папка /img_from_vk_id35163310_dt20200907234019
Я.Диск: файл /img_from_vk_id35163310_dt20200907234019/9.jpg вскоре будет загружен
Я.Диск: файл /img_from_vk_id35163310_dt20200907234019/5.jpg вскоре будет загружен
main: информация о файлах сохранена в img_from_vk_id35163310_dt20200907234019_data.json