Yahoo Online/Offline Status Indicator

I am trying to redesign my homepage at the moment and in the process applying my new found skills with PHP. ๐Ÿ™‚ One thing I put in on all the versions of my homepage is a online status indicator with Yahoo! so that people can contact me directly and have their bricks on my face. Usually I go with the normal script code Yahoo! with their default images for online and offline statuses. But this time, I wanted to display custom images for my online and offline status indicators.

A quick search led me to a where online status is checked using various links from yahoo themselves. It was a good source of inspiration. I used this piece of code:

http://mail.opi.yahoo.com/online?u=[username]&m=a&t=1

Which showed a 00 for offline and 01 for online. After a million errors, my newbie skills finally graduated and I created this script which checks for online and offline status of a username and displays custom images depicting the same.

<?
//Insert yahoo messenger status
$check_it = “http://mail.opi.yahoo.com/online?u=getanand321&m=a&t=1″;
$id =”getanand321″;
$online=”<a href=’ymsgr:sendIM?getanand321′><img src=’http://theanand.com/images/online-smile.png’ border=’0′></a><br>”;
$offline=”<img src=’http://theanand.com/images/offline-smile.png’><br>”;
$file = fopen(“$check_it”.”$id”, “r”);$read = fread($file, 200);
$read = ereg_replace($id, “”, $read);
if ($y = strstr ($read, “00”)) {
$x = “$offline”;
}elseif ($y = strstr ($read, “01”)) {
$x = “$online”;
}
echo (“$x”);
fclose($file);
?>

Put this into a html page and save it as a .php file and upload. Done! I was surprised that I could do this in just 10-15 lines of code than be using any third party script! Hope this helps those who are looking for a solution to display their yahoo messenger status on their websites and homepages. I will soon share a script where you can display your blogs latest posts on a static homepage, in this case, my homepage which is in html at the moment.

Update: I just noted that this same procedure can be used to find if an user is invisible in yahoo or not! This is another accidental yahoo messenger invisible hack!!!


Comments

22 responses to “Yahoo Online/Offline Status Indicator”

  1. Add a Google talkback gadget buddy!!! ๐Ÿ™‚

  2. ah, I started using gtalk only recently, that too for the mobme guys ๐Ÿ˜† I love Yahoo! they rock . . .

  3. I’m pretty sure I visited this topic not long time ago and there were more comments, and in one of the comment a guy posted a link to a page where you could see if a yahoo user is offline or invisible…it was a vietnam site, were the comments deleted ?

  4. thanks ^.^

  5. Hi there I am trying to find some help about using the yahoo online status indicator

    I can insert the yahoo smily online face and get it to work ok

    First I have a chat site that alows users to check out other profiles and chat to them

    I have a list off all the members to my site and they all have yahoo smiley faces so I can see who is online on yahoo I want to be able to search my site to filter the members to only display those members that are signed in to yahoo messenger not to show the members of my site that are logged in to my site

    SO that on my on my search page I can have i am a _____ looking for a _________ and also have a field for show only people who are online yahoo

    Does anyone know how I could get this to work?

    Any help would be great

  6. Thannks I have used it on site http://www.berita.me
    Thank You

  7. Cool Script!10x for share!

  8. php newb here as well ๐Ÿ™‚

    your code inspired this:

    <?php
    $getstatus = file_get_contents(‘http://mail.opi.yahoo.com/online?u=westlacomputerservices&m=a&t=1’);
    switch($getstatus)
    {
    case “00”:
    $status = ”;
    break;
    case “01”:
    $status = ‘‘;
    break;
    }
    echo “Live chat is currently “.$status;
    ?>

  9. Woo…thats an interesting application of the code Chuck ๐Ÿ™‚

    Have you tried the Yahoo! Pingbox here:
    http://messenger.yahoo.com/pingbox/

    I use it for my chats on the homepage. Its pretty useful and helps to show if our yahoo account is online or offline and integrates sitewide chat too. But does not help with invisible check of yahoo accounts. ๐Ÿ™‚

  10. It’s not working with yahoo ALIAS, anyone know a way get around it ?

  11. Thanks for the code

  12. Hi This was a great code that helped for one of my client.. Thanks Sachin

  13. Hello any one can provide me yahoo web messenger to my website please any one know can give me details

  14. jessica Avatar

    emena me aresi poli na milao ke to yahoo mu aresi poli

  15. This is usefull for me as a newbie. Thank’s so much

  16. At this line:
    $check_it = โ€œhttp://mail.opi.yahoo.com/online?u=[username]&m=a&t=1?;
    in the browser gives
    Parse error: syntax error, unexpected ‘:’ in /home/tulceavi/public_html/p5.php on line 3

  17. thanks mate…

  18. try to change the m variable to g, you can see your online status in picture now.
    you can change the picture by changing the t variable

    Example:
    http://mail.opi.yahoo.com/online?u=%5Busername%5D&m=g&t=5

  19. Podaru Marius Avatar
    Podaru Marius

    I found a bug for me! :|. “Parse error: syntax error, unexpected ‘:’ in /home/informat/public_html/gtsoft.ro/html.php on line 3” . Anybady can solve that?

  20. Qasim azam Avatar
    Qasim azam

    Thanks Buddy you code help me alot.

  21. Here is another invisible scanner http://www.ymland.com it is a very simple and helpfull tool

    to detect invisible users.

  22. kitty Avatar

    I hope I can get an answer here. From the comments it’s been a while since anyone has posted but I’m asking anyway. I wanted to know if your pHp code is saved in a php file or does it have to be incorporated into the sites index.html for it to work properly? And can I just do the buttons myself and put them on my server to acces them so I don’t have to count on a different site to stay up

Leave a Reply

Your email address will not be published. Required fields are marked *