Post: [Source]MSN Online Status Checker[Fully commented]
05-10-2011, 12:58 AM #1
(adsbygoogle = window.adsbygoogle || []).push({});
Originally posted by 039

Since I failed to find any public sources, I decided to make my own.

    <?php
//MSN CUSTOM ONLINE STATUS CHECKER BY XERODAY for HackForums

//Before usage, go to https://settings.messenger.live.com/applications/WebSettings.aspx?wa=wsignin1.0 and make sure that "Allow anyone on the web to see my presence and send me messages." is checked.

//USAGE = [email protected]

//Disable client-side caching for more accurate checking
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");


//Grab image information for default MSN icon and save to array ($image)
$image = getimagesize("https://messenger.services.live.com/users/" . $_GET["msn"] . "/presenceimage?mkt=en-US");


header("Content-type: image/png"); //Signify that the output will be a PNG
if ($image["bits"] == "7") { //Read "bits" from $image array. When bits = 7, status is online, busy, away, idle, etc... When bits = 6, status is offline
$im = imagecreate(84, 16); //Create image with dimensions 84 x 16 for optimal size.
$background_color = imagecolorallocatealpha($im,0,0,0,127); //Create transparent background.
$textcolor = imagecolorallocate($im, 0, 255, 0); //Make text color green
imagestring($im, 4, 0, 0, "I'm Online!", $textcolor); //Write text onto image.
} else {
//OFFLINE
$im = imagecreate(92, 16); //Create image with dimensions 92 x 16 for optimal size.
$background_color = imagecolorallocatealpha($im,0,0,0,127); //Create transparent background
$textcolor = imagecolorallocate($im, 255, 0, 0); //Make text color red
imagestring($im, 4, 0, 0, "I'm Offline!", $textcolor); //Write text onto image
}
imagepng($im); //Output the image
imagedestroy($im); //End the image stream
?>





source You must login or register to view this content.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo