39 lines
756 B
Python
39 lines
756 B
Python
import vk_api
|
|
import json
|
|
|
|
vk_session = vk_api.VkApi('+79167941799', 'cjghjvfn_1q2w3e')
|
|
vk_session.auth()
|
|
|
|
vk = vk_session.get_api()
|
|
|
|
"""
|
|
izbr = vk.fave.get()
|
|
|
|
query_length = izbr['count']
|
|
|
|
|
|
#print(izbr['items'][i]['post']['attachments'][0]['link']['title'])
|
|
|
|
|
|
print(len(izbr['items']))
|
|
"""
|
|
|
|
tools = vk_api.VkTools(vk_session)
|
|
|
|
fave = tools.get_all('fave.get', 100)
|
|
|
|
|
|
"""
|
|
if fave['count']:
|
|
for i in range(fave['count']):
|
|
print(i)
|
|
if fave['items'][i]['type'] == 'article':
|
|
print(fave['items'][i]['article']['view_url'])
|
|
elif fave['items'][i]['type'] == 'post':
|
|
print(fave['items'][i]['post'])
|
|
"""
|
|
|
|
|
|
json_string = json.dumps(fave)
|
|
with open('json_data.json', 'w') as outfile:
|
|
outfile.write(json_string) |