A
A
Amadora2016-08-01 12:12:32
In contact with
Amadora, 2016-08-01 12:12:32

How to update the cover photo of a community in vk.com automatically?

Idea: Display a map of traffic jams along a certain street in the interactive menu using the Static Yandex api.
Problem: There is a community. The community has an interactive menu. The menu uses the internal link format . Those. external link is not loading. Is there any way to update a photo with the same ID (it is doubtful that there is such a thing). Is it possible to somehow automatically change the ID of certain photos in the menu wiki markup?
py.sy.
I'm not a developer, I can make mistakes in simple steps. Do not burn at the stake

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Petr Flaks, 2016-08-02
@neluzhin

The step of actions to automate the process you have planned will be something like this:

  1. Download the map image using the Yandex API. In this API, I can’t suggest anything - I had no experience.
  2. Create an album in your community.
  3. In this album, upload the image from the maps that you downloaded in the first step. The documentation says how to upload pictures to an album.
  4. After uploading an image, you will receive its ID. In VKontakte, the photo object has the following format: photo*owner*_*id*. Accordingly, to get the object of the photo you uploaded, just substitute your data. *owner* is the ID of the owner (communities have a negative ID), and *id* is the ID of the uploaded image. Let's say your community ID is 108671097, and the ID of the uploaded image is 425093800. Your total photo object will look like this: photo-108671097_425093800.
  5. Now you need to create a template for your wiki page. Here is an example in PHP:
    /* переменная $photo_object задается, допустим, после загрузки картинки */
    $template = "==Карта пробок в Санкт-Петербурге==\n";

    And all this needs to be put into cron for automation. That's all. You can also read the unofficial documentation on the VKontakte wiki markup .
    In general, without basic knowledge of programming, it will not work to write this. Try to contact a freelance exchange, the script will turn out to be simple, they will write you for 500-1000 rubles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question