Then if the handle exists as a key in our hash, we do something. My ($user, $status) = if $status ne 'ONLINE' įirst we disregard notifications where the user has just went off-line by Handle_of_boss => 'Pretend you are busy working!', (In this case my mother), and print the message only when the user handle matches one of the keys: I could create a hash of "username" => "Text message" pairs for the important people. In the above example I only printed it along with the fullname but I could do other interesting things. This is the unique Skype ID of the person. The Skype::Any::Object::User has all kinds of interesting methods providing details about that specific contact, but the most interesting to us is the handle field. In the short time I ran this script I only saw the strings NA, OFFLINE, and ONLINE. The first one is a Skype::Any::Object::User object and the second one is the new status of the user. When a user changes their status, this function will be called and two values will be passed. We are interested in the user-related events, so register the event handler $skype->user passing an anonymous subroutine to it. By default Skype::Any would use the name Skype::Any, but in the constructor we gave it another name.Īnyway, once the connection is established, the events in the Skype client will generate call-backs in our script. Later you can turn this off, from within Skype.Īlso, as far as I understand the permission is given to a third-party application with a specific name. (For a screenshot see the documentation of Skype::Any.) You can let this script connect to your Skype once or always. The Skype client will ask for your permission. When you run this script it will try to connect the already running Skype client. My $skype = Skype::Any->new(name => "Selective Notification Agent") So this whole solution might go away in a few weeks. Shutting down part of this API in December 2013. (version 0.06) it only works on Linux and Mac OSX. As I read in the documentation, the module
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |