Update…
Unfortunately, LogMeIn figured out they forgot about that page, I guess when people started reading this post and hitting it on their servers. They have removed the text status as well as all the others, and I can’t figure out why they would do such a thing.
I’m also not sure what they’re offering as an alternative either. So if you know, please leave a comment below. Thanks.
Depreciated Process…
A while back, I started a project called tsn.lcl or tsnlocal, but gave up on it when my electricity bill hit $400 in a month.
Today, I decided to fix up the domain name and get it back on the internet – at least to remove it from GoDaddy’s Parking Page – where they’re making money, not me, off of it.
When I got it published I noticed that none of the Hamachi Web Status images worked anymore, and that the link to such an image, redirected to their login page for your Hamachi Management Dashboard. However, upon further investigation, I found that there was not only an Image version of those status instances, but also a text version.
I really wanted to show the online status of all my machines again, so I wrote my own php script to parse that text data, and created some simple images to show on the website based on the returned status.
So here’s the code so you can do the same thing…
The PHP Function
[cc lang=”php”]<?php
function hamachiImg($ip) {
$url = “https://my.hamachi.cc/status/text.php?$ip”;
$status = file_get_contents($url);
$status = preg_replace(‘/\d*\.\d*\.\d*.\d* /’, ”, $status);
$image_url = “./images/$status.png”;
return $image_url;
}
?>[/cc]
This code creates a $url variable with the address to the text status, based on the $ip that is passed to it. Then it requests the data, removes the ip address and the trailing space, leaving only the status text. On the server, I have a collection of images with the 4 different statuses as their file name, and with that an $image_url is created to be returned.
The 4 possible statuses are:
- – online
- – offline
- – unknown
- – error
The HTML Code and PHP Function Call
Once you have your php function in the page (I stuck mine before the first <html> tag), you can use the php function to insert the image url when you pass it an IP…
[cc lang=”html”]<table>
<tr>
<td style=”width: 100%”>[[Neo]]:</td>
<td style=”width: 100%”> <img src=”<?php echo hamachiImg(‘5.37.117.104’); ?>”></td>
</tr>
</table>[/cc]
Once you’ve done that, assuming you have entered a valid hamachi IP address, the results should look something like the image at right.
4 replies on “Hamachi Web Status Images”
it expired
Yeah, it expired shortly after I created the post.
it doesn’t worked for html…
Nope, it doesn’t work at all anymore. I updated the post when I found out a couple months ago.