Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, json
- method="wall.get"
- domain="roctbb"
- count = 100
- offset= 0
- token = '53e5487153e5487153e54871d8538926b7553e553e548710eb81191ec33873a1a5d7055'
- url = "https://api.vk.com/method/wall.get?domain={}&offset={}&count={}&access_token={}&v=5.74".format(domain,offset, count, token)
- response = requests.get(url)
- data=response.json()
- num=data['response']['count']
- max_post=data['response']['items'][0]
- for offset in range(0,num,100):
- url= "https://api.vk.com/method/wall.get?domain={}&offset={}&count={}&access_token={}&v=5.74".format(domain,offset, count, token)
- response = requests.get(url)
- data = response.json()
- for post in data['response']['items']:
- if post['likes']['count']>max_post['likes']['count']:
- max_post['likes']['count']=post['likes']['count']
- print(max_post['likes']['count'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement