Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get user status in VK.com by JavaScript
    primarykey
    data
    text
    <p>Hey Guys, I've tried to get User's status on VK.com by JavaScript, but i didn't got it. So, I need to know is User online or not. I need it to use with Greasemonkey and jquery. I've tried to parse friend's list and I tried to work with JS API on VK.com but I don't have enough knowledges to make it. Could you guys give me some examples, please? </p> <p>Script bellow:</p> <pre><code>// ==UserScript== // @name LoveOnline // @namespace vk.com/dpron // @description LoveOnline // @author dpro // @include *vk.com/* // @include *vkontakte.ru/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js // @require http://vkontakte.ru/js/api/xd_connection.js?2 // ==/UserScript== var RefreshInterval = 20000; function IsOnline() { var love = $('.labeled a').attr('href'); var friends = '/friends.php' $.get(friends, function(data) { var Online = 1 if (Online != 0) { $('.labeled').append(' '+ 'online' + love); } else { $('.labeled').append(' '+ 'not online'); } }); } VK.init(function() { VK.api("friends.getOnline", {uids:"1,2,3,4"}, function(data) { // ?What here? }); }); $(document).ready(function() { IsOnline(); setInterval(function() { IsOnline() }, RefreshInterval); }); </code></pre> <p><a href="http://vkontakte.ru/pages.php?o=-1&amp;p=%D0%9E%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5+%D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D0%BE%D0%B2+API" rel="nofollow">http://vkontakte.ru/pages.php?o=-1&amp;p=%D0%9E%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5+%D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D0%BE%D0%B2+API</a> Some API here, but I think there we have 2 ways: 1. Use API from JS 2. Parse HTML on friends list</p> <p>VK.com is a facebook analogue in russia and closest countries.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload