pyvk
pyvk copied to clipboard
vkontakte.ru (largest Russian social network) python API wrapper, fork of https://bitbucket.org/kmike/vkontakte/src and modified
HOW TO USE
import vkontakte vk = vkontakte.API('YOUR_APP_ID', 'YOUR_APP_SECRET') print vk.getServerTime()
HOW TO AUTHORIZE YOUR WEB APP (bottle.py application as example)
-
User must go to this link (You need to feel PERMISSIONS from this page http://goo.gl/mj4zg) Authorize me!
-
You must to store response CODE on your YOUR_RETURN_URL and receive your ACCESS_TOKEN to your application code = request.GET.get('code') get = http.get('https://api.vkontakte.ru/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&code=' + code, 1) json_obj = json.loads(get) access_token = json_obj['access_token']
-
You can store ACCESS_TOKEN to client cookies response.set_cookie("access_token", access_token)
-
Now you can make requests to vkontakte secured area photos = vk.get('photos.getAlbums', uid='4563348', access_token = access_token)
TROUBLES
If you have any trouble or bug report - please, write me e-mail or direct message!