D
D
Dmitry2017-03-17 14:59:42
Python
Dmitry, 2017-03-17 14:59:42

How do I like it in a VK group using vk api + python?

How to like all posts, photos and videos in a VK group on behalf of a user (not a group admin)?

import vk

app_id, login, password = 'appid', 'login', 'pass'
session = vk.AuthSession(app_id, login, password, scope='messages')
vk_api = vk.API(session, v='5.62')

and then I got stuck in the documentation, I can’t understand how, having logged in under myself, go to the desired group, for example, with music or films and like all the publications that are on the wall, then move to albums and like each photo there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Khromov, 2017-03-17
@ipatov_dn

Looking at the documentation, the following sequence comes to mind:
1. Get a list of groups for the current user using the groups.get method ---- https://vk.com/dev/groups.get
2. Get all posts on the wall in the desired group using the method wall.get ---- https://vk.com/dev/wall.get
3. Loop through all the objects received by the wall.get method and use the like_adds method with the necessary parameters ---- https://vk. com/dev/likes.add
Accordingly, you do the same with albums and photos by finding the necessary methods in the API.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question