V
Vijoy Varghese
Hello Group,
My final goal is to show a green/red gif image on my webpage when I am
available on yahoo chat. Yes for this I could have used the url
provided by yahoo
http://opi.yahoo.com/online?u=xxxx&m=g&t=2, where xxxx is my yahoo
userid. But the images yahoo print wont match with my webpage's
colors. So I want to display a custom one. Now I know some Perl and I
decided to give it a try.
I used the LWP module to get the image (either online image/ offline
image) from yahoo.
______
use LWP::UserAgent;
use LWP;
use CGI;
my $q=new CGI;
my $browser = LWP::UserAgent->new;
my @ns_headers = (
'User-Agent' => 'Mozilla/4.76 [en] (Win98; U)',
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
image/png, */*',
'Accept-Charset' => 'iso-8859-1,*,utf-8',
'Accept-Language' => 'en-US',
);
my $url='http://opi.yahoo.com/online?u=vishnutp3&m=g&t=2';
$res = $browser->get($url, @ns_headers);
print $q->header(-header=>'text/html');
print $res->content;
______
Now, I have the image from yahoo through my script. Now what I want is
to see if the image is that of 'online_status' or 'offline_status'.
And according to that, display my custom 'online/offline' image.
For this, what I can do is to get the two images from yahoo, when my
id is offline and when my id is online and save it.
Then when ever the script is called, compare the real_time image from
yahoo to the ones saved and take the decision.
Now, my question is, Which is the best way to compare the remote image
with the one I have on my server?
Can I embbed the data of the image on my server to the perl program,
will this be efficient(because no read from file is required)? I tried
everything using trial and error methods, but seems like the
difference between 'ascii' and 'binary' mode is doing the trick and I
am not able to compare the image from remote computer(yahoo) and the
image on myserver.
Can some one guide me, or give me pointers to some online resource
which will help me to solve the problem with maximum efficiency?
Thankyou for all helps in advance,
Regards
Vijoy Varghese
My final goal is to show a green/red gif image on my webpage when I am
available on yahoo chat. Yes for this I could have used the url
provided by yahoo
http://opi.yahoo.com/online?u=xxxx&m=g&t=2, where xxxx is my yahoo
userid. But the images yahoo print wont match with my webpage's
colors. So I want to display a custom one. Now I know some Perl and I
decided to give it a try.
I used the LWP module to get the image (either online image/ offline
image) from yahoo.
______
use LWP::UserAgent;
use LWP;
use CGI;
my $q=new CGI;
my $browser = LWP::UserAgent->new;
my @ns_headers = (
'User-Agent' => 'Mozilla/4.76 [en] (Win98; U)',
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
image/png, */*',
'Accept-Charset' => 'iso-8859-1,*,utf-8',
'Accept-Language' => 'en-US',
);
my $url='http://opi.yahoo.com/online?u=vishnutp3&m=g&t=2';
$res = $browser->get($url, @ns_headers);
print $q->header(-header=>'text/html');
print $res->content;
______
Now, I have the image from yahoo through my script. Now what I want is
to see if the image is that of 'online_status' or 'offline_status'.
And according to that, display my custom 'online/offline' image.
For this, what I can do is to get the two images from yahoo, when my
id is offline and when my id is online and save it.
Then when ever the script is called, compare the real_time image from
yahoo to the ones saved and take the decision.
Now, my question is, Which is the best way to compare the remote image
with the one I have on my server?
Can I embbed the data of the image on my server to the perl program,
will this be efficient(because no read from file is required)? I tried
everything using trial and error methods, but seems like the
difference between 'ascii' and 'binary' mode is doing the trick and I
am not able to compare the image from remote computer(yahoo) and the
image on myserver.
Can some one guide me, or give me pointers to some online resource
which will help me to solve the problem with maximum efficiency?
Thankyou for all helps in advance,
Regards
Vijoy Varghese