def execute_in_vk(method, params={}): p = params p.update({"access_token": ACCESS_TOKEN, "v": API_VERSION}) address = net.construct_https_url(BASE_URL, path=method, params=p) res = url.urlopen(address).read() return res
def get_dialogs(count = 5): method = 'messages.getDialogs' address = net.construct_https_url(BASE_URL, path=method, params={ "access_token": ACCESS_TOKEN, "v": API_VERSION, "count": count }) # print address res = url.urlopen(address).read() print res
def get_online_friends(): method = 'friends.getOnline' address = net.construct_https_url(BASE_URL, path=method, params={ "access_token": ACCESS_TOKEN, "v": API_VERSION, "count": 10 }) # print address res = url.urlopen(address).read() print res
def read_dialog(user_id, count = 15): method = 'messages.getHistory' address = net.construct_https_url(BASE_URL, path=method, params={ "access_token": ACCESS_TOKEN, "v": API_VERSION, "user_id": user_id, "count": count, }) # print address res = url.urlopen(address).read() print res