<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml xml:lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/vnd.wap.wml; charset=utf-8"/>
<meta http-equiv="Cache-Control" content="no-cache"/></head>
<card title="使用 Google 工具栏追踪 Blog 留言 - Gracecode.com">
<p>每个开 Blog 的兄弟都会时刻关注 Blog 上的留言，上次已经说道如何<a href="http://www.gracecode.com/Archive/Display/49" title="http://www.gracecode.com/Archive/Display/49">使用 Gtalk 追踪网站的留言</a>。</p>

<p>在使用 Google 工具条时发现其实 Google 工具条本身也开放了 API 供用户调用。第一步要做的就是将用户留言做成 RSS 格式的输出（其实也就是 XML 格式，Wordpress 已经有这样的功能了）。</p>

<p>然后我们再写个针对 Google 工具条的 XML 文件即可。格式如下</p>

<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;custombuttons xmlns=&quot;http://toolbar.google.com/custombuttons/&quot;&gt;
    &lt;button&gt;
       &lt;site&gt;在这里设置点击按钮以后进入的网址&lt;/site&gt;
       &lt;title&gt;我是按钮的标题&lt;/title&gt;
       &lt;description&gt;我是按钮的描述&lt;/description&gt;
       &lt;feed refresh-interval=&quot;1800&quot;&gt;RSS 地址&lt;/feed&gt;
       &lt;icon mode=&quot;base64&quot; type=&quot;image/x-icon&quot;&gt;
           base64 以后的 ico 文件内容
       &lt;/icon&gt;
    &lt;/button&gt;
&lt;/custombuttons&gt;</pre><p>具体的例子可以<a href="http://www.gracecode.com/lab/google_btn.xml" title="http://www.gracecode.com/lab/google_btn.xml">参看这里</a>，其中 title 与 description 不言而喻，是标题以及描述，最为重要的是 feed 标签。feed 的值就是任何的 RSS 链接，针对本文就是其留言的 RSS 地址。refresh-interval 属性是刷新的间隔时间，单位是秒。</p>

<p>然后我们可以根据 Google 工具栏提供的链接将我们已经做好的 XML 格式的按钮添加到 Google 工具条中。格式为</p>

<pre>http://toolbar.google.com/buttons/add?url=&lt;XML 文件 URL 地址&gt;</pre><p><img src="http://pic.yupoo.com/feelinglucky/362615738b19/medium.jpg" alt="http://pic.yupoo.com/feelinglucky/362615738b19/medium.jpg" title="http://pic.yupoo.com/feelinglucky/362615738b19/medium.jpg" /></p>

<p>访问这个生成的链接就可以加入到 Google 工具条了，效果如图上所示。比如</p>

<p><a href="http://toolbar.google.com/buttons/add?url=http://www.gracecode.com/lab/google_btn.xml" title="http://toolbar.google.com/buttons/add?url=http://www.gracecode.com/lab/google_btn.xml">点击这里将 Gracecode.com 的文章加入 Google 工具条</a></p>

<p>最后，有关多的信息，可以参看 Google 工具条的<a href="http://toolbar.google.com/buttons/intl/zh-CN/apis/howto_guide.html" title="http://toolbar.google.com/buttons/intl/zh-CN/apis/howto_guide.html">中文 API 文档</a>。</p>


<p>
<a href="http://www.gracecode.com/wap/">Gracecode.com</a> |
<a href="http://www.gracecode.com/wap/d/1448 ">Permalink</a>(<a href="http://www.gracecode.com/Archive/Display/1448 ">xHTML</a>) |
<a href="http://www.gracecode.com/Trackback/Recieve/1448/utw3kc">Trackback</a> |
<a href="http://rss.gracecode.com">Rss</a>
</p>
</card>
</wml>