SkypeAPI - Skype API simple implementation, only support windows platform now.
0.06
use SkypeAPI; my $skype = SkypeAPI->new(); print " skype available=", $skype->attach , "\n"; my $command = $skype->create_command( { string => "GET USERSTATUS"} ); print $skype->send_command($command) , "\n"; $command = $skype->create_command( { string => "SEARCH CHATS"} ); print $skype->send_command($command) , "\n";
Returns a SkypeAPI object.
my $skype = SkypeAPI->new();
Attach to skype, return 1 if attached ok.
Send command to skype, return the reponse of skype
It sometimes failed when sending message to skype, so we have to retry sending message. $try_times default is 10.
Create command. $opt is a hashref. You can defind the command string, timeout in it.
timeout default is 10 seconds.
my $command = $skype->create_command( { string => "SEARCH CHATS", timeout => 5} );
Add listener to the chain of message handler.
$skype->register_handler(\&handler); $skype->attach(); sub handler { my $skype = shift; my $msg = shift; my $command = $skype->create_command( { string => "GET USERSTATUS"} ); print $skype->send_command($command) , "\n"; }
After you register handlers, call $skype->listen to enter the message loop;
$skype->listen();
Call stop_listen in your handler to exit the message loop
sub handler { my $skype = shift; my $msg = shift; $skype->stop_listen(); }
A Perl simple implementation of the Skype API, working off of the canonical Java and Python implementations. It is a encapsulation of Windows message communication between Skype and client applications. This version of SkypeAPI only implement some commands of SKYPE API, you can implement the others using SkypAPI->send_command
None by default.
You can find the robot.pl in the lib/../t/robot.pl, run it and your skype will become a xiaoi robot :)
the robot needs the module XiaoI, please install it first, See http://code.google.com/p/xiaoi/
For more command information, See https://developer.skype.com/Docs/ApiDoc/src
The svn source of this project, See http://code.google.com/p/skype4perl/
laomoi ( laomoi@gmail.com )
Copyright (C) 2008 by laomoi
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itinstance, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install SkypeAPI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SkypeAPI
CPAN shell
perl -MCPAN -e shell install SkypeAPI
For more information on module installation, please visit the detailed CPAN module installation guide.