I want to tell you about my VK :: App module for creating client applications in the vk.com social network. The main features of the module:
- Authorization based on OAuth 2.0, by login / password or cookies.
- Setting permissions that will be required by the application.
- Execution of any VK API requests and getting the result in JSON, XML or Perl Object form.
The module uses a minimum of dependencies: only LWP and JSON.
To write a client application, you need to know
api_id . To do this, you can
register your application or use the existing
api_id .
Syntax
Constructors
Query examples
The module is published on cpan. More detailed documentation and description of all methods:
https://metacpan.org/module/VK::App .
')
Why do you need another bike?
Because other bikes have square wheels! I have a few favorite music bands and friends with our musical tastes in vk.com. I wanted to have an up-to-date local copy of the music of these groups and friends, in order to listen to it, for example, in a car. those. be able to auto sync. I did not consider applications with GUI in principle. Among the console did not find suitable. It would be possible to look for an implementation of the API for other programming languages (I have experience with Ruby, Python, Java, C), but the soul lies precisely with Perl. On cpan.org there are two modules VK :: MP3 and VKontakte :: API. VK :: MP3 is a normal module, but it does not solve my problems, because deals only with the search for music. VKontakte :: API is absolutely not workable. First, for some reason, it requires the application's secret key, which is unsafe. Secondly, the request getUserSettings returns the code +1, which means the actual absence
of access rights . Thirdly, when using the third version of the constructor, the module simply drops. For these reasons, the idea of writing the module, which is discussed here, arose.
Plans
Bring to mind my vmd program (vkontakte music downloader) for which everything was started. Put it on github, maybe it will be useful to someone? I can build static binaries from a program under windows, mac, linux (there is a purchased version of PDK).
It so happened that VK :: App is my first module published on CPAN. And the publication process took two to three times more time than writing the module itself. It seems to be a lot of information on the network, but you do not know a clear sequence of actions. Yes, and there are pitfalls. I studied this question in some detail and wrote instructions for myself on how to correctly and quickly build a distribution kit of a module for its publication. I can comb it a little and post it as a separate article on habrahabr.
I will be glad to any fitbekam!
UPDabout the plans:
post about vkontakte music downloader -
habrahabr.ru/post/146889post about the publication of modules -
habrahabr.ru/post/146821In addition, vk.com changed the authorization mechanism by login and password and had to change the module. The current version of VK :: App 0.06 is working, all previous ones do not work. I suspect that the VK :: MP3 module has also stopped working.