NAME
Badge::GoogleTalk - To get your status message/online status/chat link from google talk badge for website live chat.
VERSION
version 0.0.1
SYNOPSIS
use Badge::GoogleTalk;
my $my_object = Badge::GoogleTalk->new(
key => "your identification key",
# key => "z01q6amlq5ij9dvg7gbgb2oj5jph3fohsojef08g3l0aevm02th1k13phg2bi535f9rphmm6t6bukdt93khaacb5f5qilvcqrph6gfankdkkc2vjbs2rgrjki1s35bk1910vc91qr70in1aa6hm67gbijos4q4tlc4no7jq0a",
);
# Get Your Badge's online status
my $online_status = $my_object->is_online();
my $ol_status = $online_status == 0 ? "Offline" : "Online";
# Get Your Badge's status message
my $status = $my_object->get_status();
# Check Your Badge's away status
my $away_status = $my_object->is_away();
my $aw_status = $away_status == 1 ? "Away" : "Online";
# Check Your Badge's Style
my $style = $my_object->is_classic_style();
my $style_status = $style == 1 ? "Classic badge or one/two line style" : "Hyperlink and status icon style";
# Your Badge's in HTML format
my $badge = $my_object->get_badge();
# Your chat link for your website
my $chat_link = $my_object->get_chat_box_link();
To create a simple Badge::GoogleTalk you must pass the key;
key is your identification from the google authentication.
To create your chatback badge, visit http://www.google.com/talk/service/badge/New.
If you're using a Google Apps account,
you can create a chatback badge by visiting http://www.google.com/talk/service/a/DOMAIN/badge/New where DOMAIN is the name of your domain.
Use the alphanumeric account hash to pass as key in constructor
DESCRIPTION
A simple perl module for retrieving a user's Google Talk status
Google does provide a badge, to post your status/images/links to your
website to start a chat. Using this code, we can extract the status messages, online status,
chat box link and return that information to our perl application to keep up the live chat.
METHODS
is_online
Title : is_online
Function: this will return your online status
return : 1 if online, 0 if offline
is_away
Title : is_away
Function: this will return your away status
return : 1 if away
get_status
Title : get_status
Function: this will return your status message
return : 1 if away
is_classic_style
Title : is_classic_style
Function: this will return your badge style
return : 1 if Classic badge or one/two line style, 0 if Hyperlink and status icon style
get_chat_box_link
Title : get_chat_box_link
Function: this will return you the link of you chat box
get_badge
Title : get_badge
Function: this will return you the badge iframe to use for your website
DIAGNOSTICS
This module depends on the output from a hosted web page by Google. If Google
decides at any time to change this output, the module will likely fail.
Please e-mail me if this is the case, so we can get it working again.
INSTALLATION
To install this module, run the following commands:
perl Makefile.PL
make
make test
make install
Alternatively, to install with Module::Build, you can use the following commands:
perl Build.PL
./Build
./Build test
./Build install
COPYRIGHT AND LICENCE
Copyright (C) 2009, Rakesh Kumar Shardiwal
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.