Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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