VK.api( "execute", { code: 'return API.audio.get( {"uid" : "my_ID"} );' }, function(data) {
console.log( JSON.stringify(data, null, 4) );
});
{
"response": [
{
"aid": 1,
"owner_id": 100,
"artist": "и в официальных приложениях ВКонтакте",
"title": "Аудио доступно на vk.com",
"duration": 25,
"url": "https://vk.com/mp3/audio_api_unavailable.mp3"
}
]
}
<?
$acctok = '';
$id="32423345546";
$ch = curl_init("https://api.vk.com/method/users.get?uids=.$id&fields=photo_200,status&callback=?&access_token=".$acctok );
$headers = array
(
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*;q=0.8',
'Accept-Language: ru,en-us;q=0.7,en;q=0.3',
'Accept-Charset: utf-8;q=0.7,*;q=0.7',
'User-Agent: VKAndroidApp/4.38-816 (Android 6.0; SDK 23; x86; Google Nexus 5X; ru'
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
$t = curl_exec($ch);
curl_close($ch);
echo $t;
?>
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
$imp = $pdo->prepare("SELECT * FROM `User` WHERE `sex`=2 ");
$imp->execute();
while($row = $imp->fetch(PDO::FETCH_ASSOC)) {
$array[] = $row;
}
$json = json_encode($array);
echo $json;