Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###Начало php учения###
- <?php
- $pass = 'pass'; //Пароль
- $text = 'Text test!'; //Текс который нужен в статусе
- $auth = curl( 'https://oauth.vk.com/token?grant_type=password&client_id=2274003&client_secret=hHbZxrka2uZ6jB1inYsH&username='. $login .'&password='. $pass ); //Авторизация
- $json = json_decode( $auth, true );
- $access_token = $json['access_token'];
- echo "Статус установлен!";
- $statusSet = curl( 'https://api.vk.com/method/status.set?text='. urlencode( $text ) .'&access_token='. $access_token );//добавляем статус
- function curl( $url ) {
- $ch = curl_init( $url );
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
- curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
- curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
- $response = curl_exec( $ch );
- curl_close( $ch );
- return $response;
- }
- ?>
- ###Начало php учения###
Advertisement
Add Comment
Please, Sign In to add comment