<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ThePizzy.net/blog &#187; status</title>
	<atom:link href="http://thepizzy.net/blog/tag/status/feed/" rel="self" type="application/rss+xml" />
	<link>http://thepizzy.net/blog</link>
	<description>Solving the complex in 140 characters or less...</description>
	<lastBuildDate>Mon, 02 Jan 2012 15:55:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Hamachi Web Status Images</title>
		<link>http://thepizzy.net/blog/2009/09/hamachi-web-status-images/</link>
		<comments>http://thepizzy.net/blog/2009/09/hamachi-web-status-images/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 16:05:13 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[tsnLocal.net]]></category>
		<category><![CDATA[hamachi]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=474</guid>
		<description><![CDATA[Update&#8230; 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...]]></description>
			<content:encoded><![CDATA[<h2>Update&#8230;</h2>
<p>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&#8217;t figure out why they would do such a thing.</p>
<p>I&#8217;m also not sure what they&#8217;re offering as an alternative either. So if you know, please leave a comment below. Thanks.</p>
<h2>Depreciated Process&#8230;</h2>
<p><img class="alignleft size-full wp-image-628" title="LogMeIn Hamachi Logo" src="http://thepizzy.net/blog/wp-content/uploads/2009/09/hamachi1.jpg" alt="" width="384" height="189" />A while back, I started a project called <a href="http://thepizzy.net/blog/?s=tsnlocal">tsn.lcl or tsnlocal</a>, but gave up on it when my electricity bill hit $400 in a month.</p>
<p>Today, I decided to fix up the domain name and get it back on the internet &#8211; at least to remove it from GoDaddy&#8217;s Parking Page &#8211; where they&#8217;re making money, not me, off of it.</p>
<p>When I got it <a href="http://tsnlocal.net" target="_blank">published</a> I noticed that none of the Hamachi Web Status images worked anymore, and that the <a href="https://my.hamachi.cc/status/image.php?5.28.161.250">link to such an image</a>, 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 <a href="https://my.hamachi.cc/status/text.php?5.28.161.250">text version</a>.</p>
<p>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.</p>
<p>So here&#8217;s the code so you can do the same thing&#8230;</p>
<h2>The PHP Function</h2>
<p>{code type=php}&lt;?php<br />
function hamachiImg($ip) {<br />
$url = &#8220;https://my.hamachi.cc/status/text.php?$ip&#8221;;<br />
$status = file_get_contents($url);<br />
$status = preg_replace(&#8216;/\d*\.\d*\.\d*.\d* /&#8217;, &#8221;, $status);<br />
$image_url = &#8220;./images/$status.png&#8221;;<br />
return $image_url;<br />
}<br />
?&gt;{/code}<br />
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.</p>
<p>The 4 possible statuses are:</p>
<ul>
<li><img class="alignnone" title="hamachi-online" src="http://tsnlocal.net/images/online.png" alt="" width="16" height="17" /> &#8211; online</li>
<li><img class="alignnone" title="hamachi-offline" src="http://tsnlocal.net/images/offline.png" alt="" width="16" height="17" /> &#8211; offline</li>
<li><img class="alignnone" title="hamachi-unknown" src="http://tsnlocal.net/images/unknown.png" alt="" width="16" height="17" /> &#8211; unknown</li>
<li><img class="alignnone" title="hamachi-error" src="http://tsnlocal.net/images/error.png" alt="" width="16" height="17" /> &#8211; error</li>
</ul>
<h2>The HTML Code and PHP Function Call</h2>
<p>Once you have your php function in the page (I stuck mine before the first &lt;html&gt; tag), you can use the php function to insert the image url when you pass it an IP&#8230;<br />
{code type=html}&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;td style=&#8221;width: 100%&#8221;&gt;[[Neo]]:&lt;/td&gt;<br />
&lt;td style=&#8221;width: 100%&#8221;&gt; &lt;img src=&#8221;&lt;?php echo hamachiImg(&#8217;5.37.117.104&#8242;); ?&gt;&#8221;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;{/code}<br />
<a href="http://thepizzy.net/blog/wp-content/uploads/2009/09/hamachi-example.png"><img class="alignright size-full wp-image-477" title="hamachi-example" src="http://thepizzy.net/blog/wp-content/uploads/2009/09/hamachi-example.png" alt="hamachi-example" width="210" height="201" /></a>Once you&#8217;ve done that, assuming you have entered a valid hamachi IP address, the results should look something like the image at right.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/hamachi' rel='tag' target='_blank'>hamachi</a>, <a class='technorati-link' href='http://technorati.com/tag/images' rel='tag' target='_blank'>images</a>, <a class='technorati-link' href='http://technorati.com/tag/status' rel='tag' target='_blank'>status</a>, <a class='technorati-link' href='http://technorati.com/tag/vpn' rel='tag' target='_blank'>vpn</a>, <a class='technorati-link' href='http://technorati.com/tag/Web' rel='tag' target='_blank'>Web</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2009/09/hamachi-web-status-images/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

