<?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>WLACS Tech Blog &#187; html</title>
	<atom:link href="http://blog.wlacs.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wlacs.com</link>
	<description>Community knowledge</description>
	<lastBuildDate>Mon, 06 Jul 2009 16:56:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Display Yahoo Messenger Online Status on Web Page</title>
		<link>http://blog.wlacs.com/2009/02/display-yahoo-messenger-online-status-on-web-page/</link>
		<comments>http://blog.wlacs.com/2009/02/display-yahoo-messenger-online-status-on-web-page/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 00:40:48 +0000</pubDate>
		<dc:creator>carlos</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[osi]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://blog.wlacs.com/?p=4</guid>
		<description><![CDATA[We use a &#8220;Live Chat&#8221; feature on our website to connect our clients with our technicians. Yahoo! has a great tool for adding your online status to any web page you choose.  The code is pretty straight forward:
&#60;a href="http://messenger.yahoo.com/edit/send/?.target=YOUR_YAHOO_ID"&#62;
&#60;img border="0" src="http://opi.yahoo.com/yahooonline/u=YOUR_YAHOO_ID/m=g/t=2/l=us/opi.jpg"&#62;
&#60;/a&#62;
Will return this Yahoo!-provided image:

Playing around with the Yahoo! provided source yields up to [...]]]></description>
			<content:encoded><![CDATA[<p>We use a &#8220;Live Chat&#8221; feature on our website to connect our clients with our technicians. Yahoo! has a great <a href="http://pager.yahoo.com/addpresence.php">tool</a> for adding your online status to any web page you choose.<span id="more-4"></span>  The code is pretty straight forward:</p>
<p><code>&lt;a href="http://messenger.yahoo.com/edit/send/?.target=YOUR_YAHOO_ID"&gt;<br />
&lt;img border="0" src="http://opi.yahoo.com/yahooonline/u=YOUR_YAHOO_ID/m=g/t=2/l=us/opi.jpg"&gt;<br />
&lt;/a&gt;</code><br />
Will return this Yahoo!-provided image:<br />
<img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=2/l=us/opi.jpg"></p>
<p>Playing around with the Yahoo! provided source yields up to 17 different images. Changing the <strong>t=2</strong> tag above to <strong>t=0</strong> will give you:<br />
<img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=0/l=us/opi.jpg"></p>
<p>Here&#8217;s what&#8217;s avaialbe (t=0 through t=16):<br />
<img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=0/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=1/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=2/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=3/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=4/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=5/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=6/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=7/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=8/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=9/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=10/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=11/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=12/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=13/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=14/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=15/l=us/opi.jpg"><img border="0" src="http://opi.yahoo.com/yahooonline/u=westlacomputerservices/m=g/t=16/l=us/opi.jpg"></p>
<p>Yahoo! gives us a pretty good range of options&#8230; but what if we want to use a custom image or text? Let&#8217;s look at the code again, this time, paying close attention to:</p>
<p><code>http://opi.yahoo.com/online?u=YOUR_YAHOO_ID&amp;m=a&amp;t=1</code></p>
<p>Following that link in our browser brings us to what appears to be a status page that simply displays</p>
<p><code>00</code></p>
<p>if we&#8217;re logged off, and</p>
<p><code>01</code></p>
<p>if we&#8217;re signed in.</p>
<p>If we play with this URL a bit and change <b>t=1</b> to <b>t=0</b>, we get the same status page with different output:</p>
<p><code>YOUR_YAHOO_ID is NOT ONLINE</code></p>
<p>or</p>
<p><code>YOUR_YAHOO_ID is ONLINE</code></p>
<p>For our purposes, less is more. We&#8217;ll write a simple PHP script that&#8217;ll check our online status and display a corresponding image depending on our online status. The PHP is:</p>
<p><code>&lt;?php<br />
$getstatus = file_get_contents('http://mail.opi.yahoo.com/online?u=YOUR_YAHOO_ID&amp;m=a&amp;t=1');<br />
switch($getstatus) {<br />
case "00": $status = '&lt;img src="offline.jpg" /&gt;';<br />
break;<br />
case "01": $status = '&lt;img src="online.jpg" /&gt;';<br />
break;<br />
}<br />
echo $status;<br />
?&gt;</code></p>
<p>You can define <b>$status</b> however you&#8217;d like. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wlacs.com/2009/02/display-yahoo-messenger-online-status-on-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
