I fine same materials about autoposting item for vk.com ..
The token-key is taken no automatic in vk.com
for the generate token need to open link
https://oauth.vk.com/authorize?client_id=12343547&scope=groups,wall,offline,photos&redirect_uri=
https://oauth.vk.com/blank.html&display=page&v=5.21&response_type=token
where the parameter client_id transfer identifier created earlier application.
and parameter scope it means set of rules that you are awarded with the application. More info about permissions
http://vk.com/dev/permissions
After clicking on the link to confirm the transfer of the application and copy the access token directly from Urla, despite the warning contact Please do not copy data from the address bar to third-party sites. So you can lose access to your account. Thus generated token will be enough to work with a group for an unlimited time.
We write some code
Solving this problem, I tried to find a ready-made library, found here that
https://github.com/bocharsky-bw/vkontakte-php-sdk , in the end turned out a fork, which is used in the example below. For experts on the quality of the code: the library is designed solely for demonstration purposes, it does not have extensive functional tests, good documentation, optimize performance, cross-platform (requires php 5.4), and others - all of this is left to the reader to implement tireless.
So the post text from the image into the community and tags VK:
// git clone
https://github.com/Vastly/vkontakte-php-sdk
require_once('../src/Vkontakte.php');
$accessToken = 'your access token';
$vkAPI = new \BW\Vkontakte(['access_token' => $accessToken]);
$publicID = 70941690;
if ($vkAPI->postToPublic($publicID, "Привет Хабр!", '/tmp/habr.png', ['вконтакте api', 'автопостинг', 'первые шаги'])) {
echo "Ура! Всё работает, пост добавлен\n";
} else {
echo "Фейл, пост не добавлен(( ищите ошибку\n";
}