Home python wall.post python vk

wall.post python vk

Author

Date

Category

The task appeared to post posts (just with the text) in the VKontakte community, help how to make this task through Python

Solution:

Well, the fact of the matter is that the same method is made in the group, just through the authorization of the user. Look at the attributes that are transmitted to this method, there is an Owner_ID attribute, try to transfer to Iyida Group, where your bot is located (but with authorization via user key)

import requests
id = 1488.
Message = "Hello World"
params = (
  ('V', '5.107'),
  ('Access_Token', "Token"),
  ('owner_id', id), # If you need to lay out in public, the parameter must be negative
  ('Message', Message),
  ('friends_only', 0),
  ('from_group', 1)
)
Response = Requests.get ('https://api.vk.com/method/wall.post?', params = params)
Print (Response.Text)

Answer 1

VK has an open API https://vk.com/dev.php?Method= Methods

I can advise this ready library with bindings to VK Api https://github.com/python273/vk_api


Answer 2

did not try this method. But I think this can be done using the same library using the Wall.Post method, but you will need authorization through a user, and not a group, try. How to get Access_Token user can be found in Google, information a lot.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions