I want to make the simplest applications using the VK API. My javasript is bad, as I specialize in python and C ++. I read the documentation - the part understood the part there. From what I did not understand

  1. how to make a request?
  2. How to view query results?
  3. and how to do the simplest: user came in and saw the inscription "Hello% user_name%!"% user_name% - his name

    3 answers 3

    Everything is simple there, you connect their js library, then the following code, there both the request and the output of the request and just gets the first and last name, this is an example in JS:

    <?php $api_secret0 = 'wFSTTMPh0'; // Секретный ключ приложения $idVkUser = $_GET['viewer_id']; // ID пользователя ?> <script> var vk_id = <?=$idVkUser?>; var api = new vk_api('<?=$api_secret0?>','<?=$idVkUser?>', function() { api.addCallback( 'onApplicationAdded', function() { } ); }, function() { } ); api.call('getProfiles', { uids: vk_id, fields: ['first_name', 'last_name', 'nickname'], test_mode:"1" }, function(data) { var nameSaveA = data.response[0].last_name+" "+data.response[0].first_name; alert(nameSaveA); }); </script> 

      Without knowledge of JS, alas, can not do! And in general, I would say that developing an application for VC is a very laborious business. Personally, I ended up on the list of friends who installed the application. The main problem is that the server responds to requests with delays, sometimes in a few seconds. So, if you develop, do not overdo it with requests to the server!

        It is possible to do without JS for the first time. https://api.vk.com/method/users.get?user_ids=123123&v=5.8&fields=last_seen Of course, than parsing an answer from this link, I think you can think of it yourself, in php I use curl.