vk_mad is a simple library for communicating with VK API (VKONTAKTE API).
$ git clone email@example.com:amoroz/vk_mad.git $ cd vk_mad $ bundle install
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:
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.