<?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>I buzZ U buzZ, We BuzZ &#187; API</title>
	<atom:link href="http://blog.izuz.net/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.izuz.net</link>
	<description>webuzz.im for Web Google Talk, MSN Live Messenger, AIM, Yahoo! Messenger</description>
	<lastBuildDate>Thu, 29 Jul 2010 08:07:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>For Developers: Writing IM Plug-ins for izuz.net Web IMs</title>
		<link>http://blog.izuz.net/2008/10/for-developers-writing-im-plug-ins-for-izuznet-web-ims/</link>
		<comments>http://blog.izuz.net/2008/10/for-developers-writing-im-plug-ins-for-izuznet-web-ims/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 17:07:14 +0000</pubDate>
		<dc:creator>sarenshi</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Export IM Contacts]]></category>
		<category><![CDATA[IM Plugin]]></category>
		<category><![CDATA[Web IM]]></category>

		<guid isPermaLink="false">http://blog.izuz.net/?p=20</guid>
		<description><![CDATA[We are very pleased to annouce our newly IM plugin API for our potential developers. http://izuz.net/ is providing web IM (instant messenging) services for our users. Currently, the web IM services include web Google Talk (Gtalk), web Windows Live Messenger &#8230; <a href="http://blog.izuz.net/2008/10/for-developers-writing-im-plug-ins-for-izuznet-web-ims/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We are very pleased to annouce our newly IM plugin API for our potential developers.</p>
<blockquote><p><a href="http://izuz.net/">http://izuz.net/</a> is providing web IM (instant messenging) services for our users. Currently, the web IM services include <a href="http://izuz.net/gtalk/">web Google Talk (Gtalk)</a>, <a href="http://izuz.net/msnlive/">web Windows Live Messenger (MSN)</a>, <a href="http://izuz.net/ymesenger/">web Yahoo! Messenger (YMsg)</a>, <a href="http://izuz.net/aim/">AOL Instant Messenger (AIM)</a>. More services may be added later.</p></blockquote>
<p>To illustrate our web IM plugin API, we will develop a plugin to export all contact emails.</p>
<p>The final plugin codes:</p>
<blockquote><p><span style="color: #000080;">javascript:p=new net.izuz.gtalk.MainWindow.IMPluginAdapter();p.dealRoster=function(w, e){log(e.email);return false;}; net.izuz.gtalk.MainWindow.addIMPlugin(p);</span></p></blockquote>
<p>How to use this web IM plugin</p>
<ol>
<li>Logout your web IM</li>
<li>Copy the above line of codes (in fact, it is a link), and paste it into the browser&#8217;s address bar and press &lt;Enter&gt; to run the JavaScript code</li>
<li>Login your web IM</li>
<li>After all your contacts are listed, there will be a new link anchor generated inside the page named &#8220;Open System Console&#8221;. Click it will bring you a window with all your contacts&#8217; email.<br />
If you can not find the link, copy<br />
<span style="color: #0000ff;">javascript:ClazzLoader.loadClass(&#8216;org.eclipse.swt.widgets.Console&#8217;,function(){$wt.widgets.Console.openConsole();});</span><br />
And paste it into address bar and &lt;Enter&gt; will also bring you a window with all your contacts&#8217; email.</li>
</ol>
<p>IM Plugin Development Details</p>
<p>In fact, the above plugin contains following lines:</p>
<blockquote><p><span style="color: #000080;"> var plugin = new net.izuz.gtalk.MainWindow.IMPluginAdapter ();<br />
plugin.dealRoster = function (mw, evt) {<br />
log (evt.email);<br />
return false;<br />
};<br />
net.izuz.gtalk.MainWindow.addIMPlugin (plugin);</span></p></blockquote>
<p>First, all plugins should be an instance of <span style="color: #000080;">net.izuz.gtalk.MainWindow.IMPluginAdapter</span>. Here is the its Java source (You are not required as a Java expert. But we think giving its source will help you to get a better understanding) :</p>
<blockquote><p><span style="color: #000080;">public static class IMPluginAdapter implements IMPluginable {<br />
public boolean dealLogin(MainWindow mw, DuplicateLoginEvent dle) {<br />
return false;<br />
}<br />
public boolean dealTyping(MainWindow mw, TypingEvent ts) {<br />
return false;<br />
}<br />
public boolean dealMessage(MainWindow mw, MessageEvent ms) {<br />
return false;<br />
}<br />
public boolean dealRoster(MainWindow mw, RosterEvent rs) {<br />
return false;<br />
}<br />
}</span></p></blockquote>
<p>And you can override its methods to fulfill your job. The above plugin overrides its <span style="color: #000080;">dealRoster</span> method, which is about contacts&#8217; information. To override a method using JavaScript is quite an easy job:</p>
<blockquote><p><span style="color: #000080;"> plugin.dealRoster = function (mw, evt) {<br />
log (evt.email);<br />
return false;<br />
};</span></p></blockquote>
<p>In the above codes, we use <span style="color: #000080;">log()</span> method to print email into console window. <span style="color: #000080;">log()</span> method is provided by Java2Script core library. For more information about Java2Script, please visit <a href="http://j2s.sourceforge.net/">http://j2s.sourceforge.net/</a> .</p>
<p>And finally, you add the plugin to our web IM system by <span style="color: #000080;">net.izuz.gtalk.MainWindow.addIMPlugin (plugin); </span>And you can remove it later by <span style="color: #000080;">net.izuz.gtalk.MainWindow.removeIMPlugin(plugin);</span></p>
<p>More about IMPluginAdapter&#8217;s Method</p>
<blockquote><p><span style="color: #000080;">net.izuz.gtalk.MainWindow.IMPluginAdapter.dealLogin(MainWindow, DuplicateLoginEvent)<br />
net.izuz.gtalk.MainWindow.IMPluginAdapter.dealMessage(MainWindow, MessageEvent)<br />
net.izuz.gtalk.MainWindow.IMPluginAdapter.dealRoster(MainWindow, RosterEvent)<br />
net.izuz.gtalk.MainWindow.IMPluginAdapter.dealTyping(MainWindow, TypingEvent)</span></p></blockquote>
<p>These methods all have two parameters. The first parameter is the messenger window itself. You can do anything you want by using this MainWindow object. We will provide more information this instance in later articles.</p>
<p>The second parameter is about data passing back from web IM servers. There are four events. Here are their data structures:</p>
<blockquote><p><span style="color: #000080;">iz.z.event.DuplicateLoginEvent<br />
iz.z.event.DuplicateLoginEvent.beQuiet // always be true, if there is such a event<br />
</span></p>
<p><span style="color: #000080;">iz.z.event.MessageEvent<br />
iz.z.event.MessageEvent.body // message in plain text<br />
iz.z.event.MessageEvent.from // email of sender<br />
iz.z.event.MessageEvent.thread // an ID to mark the chatting session<br />
iz.z.event.MessageEvent.to // email of receiver<br />
</span></p>
<p><span style="color: #000080;">iz.z.event.RosterEvent<br />
iz.z.event.RosterEvent.avatar // user&#8217;s avatar picture hash<br />
iz.z.event.RosterEvent.confirmed // already a registered user or not<br />
iz.z.event.RosterEvent.email<br />
iz.z.event.RosterEvent.id<br />
iz.z.event.RosterEvent.mode // available, away, idle, busy, offline<br />
iz.z.event.RosterEvent.name<br />
iz.z.event.RosterEvent.status // customized status message<br />
</span></p>
<p><span style="color: #000080;">iz.z.event.TypingEvent<br />
iz.z.event.TypingEvent.from // email of sender<br />
iz.z.event.TypingEvent.typing // is typing or not</span></p></blockquote>
<p>So, you already can develop some interesting plug-ins to collect your messages and your contacts information.</p>
<p>We would like to hear your feedback for more APIs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.izuz.net/2008/10/for-developers-writing-im-plug-ins-for-izuznet-web-ims/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
