Created
June 23, 2014 17:23
-
-
Save skive/fb2ef5fe3ff2634a8889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment