Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
vk_mad is a simple library for communicating with VK.COM API
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
.gitignore
Gemfile
README.md
vk_mad.gemspec

README.md

vk_mad

vk_mad is a simple library for communicating with VK API (VKONTAKTE API).

Dependencies

mechanize

Installation

$ git clone git@github.com:amoroz/vk_mad.git
$ cd vk_mad
$ bundle install

Usage

At the beginning, you must create your own Standalone application at this page and obtain application id key which will be used in requests to the API.

To start work with the library you must first initialize vk_mad client using the obtained application id, login and password from your account. Login and password is needed only once - after the first run the cookie file that is stored on the disk will be used.

If you don't want to use your own login and password you can manually approve your application by using this link:

http://oauth.vk.com/authorize?client_id=APP_ID&scope=friends,photos,audio,video,status,wall,groups,messages,offline&response_type=token

and then grab the access token from the address on which you will be redirected.

The actual cookies and access token are stored on the disk after each vk_mad run. vk_mad attempts to use them for the future runs.
Paths to the cookie file and to the access token file can be configured in lib/vk/config.rb file.

# initialize vk_mad client
vk = VkMad::Vk.new(app_id, login: login, password: password)

After that you can make requests to VK API:

# request (e.g., get all user tracks)
res = vk.api_request('audio.get')

The response returns in hash.

Information about all API methods can be found at the links section below.

Links

Something went wrong with that request. Please try again.