C
C
checky2015-12-15 08:11:22
PHP
checky, 2015-12-15 08:11:22

How to process vk api methods through php cron?

Every day of the week, the database with users is updated:
at the input I have their id and id of their posts on the wall, I want to write to the database the number of likes on these posts by cron
, that is:
sql fetch and compose a string with id to query the vk api method
further (this is what needs to be redone for php cron) analogue on open api: (respectively, after initialization)

VK.Api.call("wall.getById", {posts: строка-с-idклиентов_id-их-записей}, function(r) {
 тут всё просто и понятно
}

and according to the answer, according to the id, the number of likes is recorded in the database,
tell me how to implement this?
the method does not require an access token or anything else, and now I imagine it as a request through
https://api.vk.com/method/wall.getById? {posts: string-with-id-of-clients_id-of-their-posts}
which returns json, how to parse it (I don't know how yet) and everything is ok, but how

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2015-12-15
@checky

When you call VK.Api.call, some kind of http request occurs.
So look at it, figure out how it is generated, and reproduce it in php in any way you like.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question