Last active
December 3, 2017 09:51
-
-
Save sergiks/838f85816c640a1bfc99ea48bf02a169 to your computer and use it in GitHub Desktop.
calling VKScript
This file contains hidden or 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
<?php | |
$params = array( | |
'code' => " говнокод here ", | |
'access_token' => $token, | |
'v' => 5.64, | |
); | |
$url = 'https://api.vk.com/method/execute'. '?' . http_build_query( $params); | |
$ch = curl_init(); | |
curl_setopt_array( $ch, array( | |
CURLOPT_RETURNTRANSFER => TRUE, | |
CURLOPT_FOLLOWLOCATION => FALSE, | |
CURLOPT_HEADER => FALSE, | |
CURLOPT_TIMEOUT => 20, | |
CURLOPT_HTTPHEADER => array('Accept-Language: ru,en-us'), | |
CURLOPT_URL => $url, | |
CURLOPT_SSL_VERIFYPEER => FALSE, | |
)); | |
if( !$response = curl_exec( $ch)){ | |
Log::error( 'error ...', array( 'error'=>curl_error($ch))); | |
return; | |
} | |
curl_close( $ch); | |
$result = json_decode($response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment