Where to get token for adjustment of status in the group?

Write code to parse the bitcoin exchange rate in status of the VC community. Problem occurs in getting the token. How to get a token to change the status on the public VC?


<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

<?php
 //Your token
 define('token_user', '1d6a7bfc26c509ad75ba904814029b2722c1ab564aeff06bd002e81209814b3c971cc018bf4ca419de365');


$tick = file_get_contents('https://api.coinmarketcap.com/v1/ticker/?limit=1');
//currency Dogecoin to 19, and therefore use ?limit=1
$data = json_decode($tick, TRUE);

$bit = $data[0]["price_usd"];
//$data[0] - the position of the currency in the list in an array counting begins from zero, don't forget!
echo "<b-->Bitcoin: ".$bit."<br>";


# the declension of words, depending on the number
//$num = $interval->days;
//$arWords = array('day','day','days');
declension_words function($num,$arWords){
 if ($num < 21){
 if ($num == 1)
 $w = $arWords[0];
 elseif ($num > 1 && $num < 5)
 $w = $arWords[1];
else
 $w = $arWords[2];
 return $w;
 } else {
 $l = (int)substr($num, -1);
 if ($l == 1)
 $w = $arWords[0];
 elseif ($l > 1 && $l < 5)
 $w = $arWords[1];
else
 $w = $arWords[2];
 return $w;
}
}


 // $_status = $interval->format('Left %R%a '.declension_words($num,$arWords).' home');
 // $_status = str_replace('+',", $_status );


$_status = "the status text ".$bit;

 metog_get function ($_metod= null, $_paramm = null) {

 $url = trim($_metod.http_build_query($_paramm));
 $curl = curl_init();
 curl_setopt($curl, CURLOPT_URL, $url);
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($curl, CURLOPT_HEADER, false);
 $data = curl_exec($curl);
 curl_close($curl); 

 if ($data != null) {
 return $data;
 } else {
 return 'Error =' .$data;
}
}

 $_param = array('text' =>$_status ,
 'group_id' => '156383365' ,
 'access_token' =>token_user
);
 $_response = metog_get('https://api.vk.com/method/status.set?',$_param); 
 //"response": 1
 $_id_status = json_decode($_response)-> response;
 if (is_int($_id_status) == 1 ) {
 echo 'OK =' .$_status ;
 } else{
 echo ('Er = '.$_id_status);
}

?>

June 10th 19 at 14:44
1 answer
June 10th 19 at 14:46
Solution
This method can be called with the access key of the user obtained in the Standalone-application using Implicit Flow. Required access rights: status.

Create a standalone application from VC, autoresume with a personal page, which is the administrator of a public, with a crowd offline status (offline for a permanent key), directly from your browser.
https://vk.com/dev/implicit_flow_user

Parsim, update the status, catch captcha...)

Find more questions by tags API