Question about comparing Remote image with Local one

From: Vijoy Varghese (viijv_at_thedifferenZ.com)
Date: 10/09/03


Date: 8 Oct 2003 23:26:10 -0700

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



Relevant Pages

  • Re: Outlool Express sbc follow up
    ... The fact that you can send OK from the online page has no relation to your ... Well, in the above anology, the server you're using at the online page is ... > trought yahoo it goes out. ... >> X-Mailer: Microsoft Outlook Express 6.00.2900.2180 ...
    (microsoft.public.windowsxp.newusers)
  • Online Daters Sue Matchmaking Sites For Fraud
    ... & Gignac LLP, which brought the suit. ... Match "promotes the policies of integrity to protect members, ... Yahoo spokeswoman Rochelle Adams said the company had no comment on ... online dating industry has slowed, ...
    (comp.dcom.telecom)
  • Re: Controlling ssh from an external program
    ... > I need to launch a SSH agent and SSH add and I would ... > Do You Yahoo!? ... Mail has the best spam ... Declare Yourself - Register online to vote today! ...
    (SSH)
  • Re: Question about comparing Remote image with Local one
    ... > available on yahoo chat. ... So I want to display a custom one. ... > I used the LWP module to get the image (either online image/ offline ... > Now, my question is, Which is the best way to compare the remote image ...
    (comp.lang.perl.misc)
  • Re: Microsoft offers $44.6B for Yahoo
    ... Yahoo, offering Yahoo shareholders cash or stock. ... MS needs to compete against Google ... MS to expand in areas of video, mobile services, online commerce, and ... Microsoft Makes Grab for Yahoo ...
    (misc.news.internet.discuss)