VK - module to work with "VKontakte" social network (vk.com), it allows to make posts with images and links, create albumbs and upload images.
Simple usage:
use VK; my $vk = VK->new('vkaccount@email.com', 'mypassword', undef, 1234); print $vk->wallPost( message => "Hello World!", link => "http://code.google.com/p/vkontakte-non-api-manager", photo => "sample.jpg" )?'Success':'Failed';
Detailed sample with comments:
use VK; my $security_code = 1234; # last 4 digits of your phone registered to account # login to post to our own wall my $vk = VK->new('vkaccount@email.com', 'mypassword', undef, $security_code); # next init sample is for group's wall posting # my $vk = VK->new('vkaccount@email.com', 'mypassword', "/mygroupaddress", $security_code); print $vk->wallPost( message => "Hello World!", # post message #to_id => 1234456, # userid/wallid where we are going to post, or void to post to own wall/group-wall link => "http://code.google.com/p/vkontakte-non-api-manager", # link link_title => "This is the title of the link popup", # link popup description link_desc => "This is the content of link popup", # link popup description signed => '', # 1/0 - signs post if note_title => '', photo => "sample.jpg", album => "This is the new album", album_desc => "This is description of a new album", album_view => 0, # 0-all, 1-friends, 2-friends&friends, 3-me album_comments => 0, # 0-all, 1-friends, 2-friends&friends, 3-me )?'Succeeded':'Failed';
Create album:
$vk->createAlbum("Album name", "Album description");
Upload photo:
$vk->addPhoto("photo.jpg", "Album name", "Album description", $view, $comments); $view # - means who can view album: 0-all, 1-friends, 2-friends&friends, 3-me $comments # - means who can view album: 0-all, 1-friends, 2-friends&friends, 3-me
Login to account:
$vk->login('vkaccount@email.com', 'mypassword', $walluri, $security_code);
Module was made using WWW::Mechanize::GZip,
so if you are going to make any modifications next modules will be useful:
WWW::Mechanize WWW::Mechanize::Gzip
Marat Shaymardanov, email: info@leonmedia.ru
Copyright (C) 2012-2013 by Marat Shaymardanov, LeonMedia LLC 2012-2013
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
2 POD Errors
The following errors were encountered while parsing the POD:
Unknown directive: =no
Non-ASCII character seen before =encoding in 'class="err">В'. Assuming UTF-8
To install VK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VK
CPAN shell
perl -MCPAN -e shell install VK
For more information on module installation, please visit the detailed CPAN module installation guide.