<?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>molezz BAR 世界尽头 &#187; api</title>
	<atom:link href="http://www.molezz.net/drink/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.molezz.net</link>
	<description>a man can be destroyed but not defeated -- 生物技术和计算机技术</description>
	<lastBuildDate>Thu, 26 Aug 2010 02:42:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>2个google ajax feed api 实例</title>
		<link>http://www.molezz.net/drink/google-ajax-feed-api-sample/</link>
		<comments>http://www.molezz.net/drink/google-ajax-feed-api-sample/#comments</comments>
		<pubDate>Mon, 25 May 2009 08:47:44 +0000</pubDate>
		<dc:creator>molezz</dc:creator>
				<category><![CDATA[电脑网络|network]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.molezz.net/archives/221</guid>
		<description><![CDATA[这两天在学着美化自己的mediawiki,由于总感觉首页很单调,于是想在上面放个实时更新的界面,使得wiki首页看上去总有更新.主要是最新词条的信息和最近修改的信息. 由于知识有限,主要是去网上找些工具和代码,发现了google ajax feed api这样个好东西.其中的AJAX Dynamic Feed Control可以直接在网页中调用. 简单介绍2个实例,具体可以去google上看看.以下代码开头中的key=notsupplied-wizard这段在实际使用中请改成具体的google API key. 1.第一个比较简洁,列出RSS的标题和简洁,可以添加多个RSS. 效果见这. &#60;script type=&#34;text/javascript&#34; src=&#34;http://www.google.com/jsapi?key=notsupplied-wizard&#34;&#62;&#60;/script&#62; &#60;script type=&#34;text/javascript&#34;&#62; google.load&#40;&#34;feeds&#34;, &#34;1&#34;&#41;; function initialize&#40;&#41; &#123; var feedControl = new google.feeds.FeedControl&#40;&#41;; feedControl.addFeed&#40;&#34;http://feed.feedsky.com/molezz&#34;, &#34;molezz BAR&#34;&#41;; feedControl.addFeed&#40;&#34;http://feed.feedsky.com/molezz&#34;, &#34;molezz BAR2&#34;&#41;; feedControl.draw&#40;document.getElementById&#40;&#34;feedControl&#34;&#41;&#41;; &#125; google.setOnLoadCallback&#40;initialize&#41;; &#60;/script&#62; &#60;div id=&#34;feedControl&#34;&#62;Loading&#60;/div&#62; 2.第二个比较花哨,有动态效果,也可以添加多个RSS,效果见这. &#60;div id=&#34;feed-control&#34;&#62; &#60;span style=&#34;color:#676767;font-size:11px;margin:10px;padding:4px;&#34;&#62;Loading...&#60;/span&#62; &#60;/div&#62; &#160; &#60;!-- Google Ajax Api --&#62; &#60;script src=&#34;http://www.google.com/jsapi?key=ABQIAAAAYyAcC_2-AB_-d2frcEenJhT_l7btg2vey3SF4xrWe8eMrDUaihT1d3ADiu199b_6prRFCyRUi-QoAQ&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>这两天在学着美化自己的mediawiki,由于总感觉首页很单调,于是想在上面放个实时更新的界面,使得wiki首页看上去总有更新.主要是最新词条的信息和最近修改的信息.</p>
<p>由于知识有限,主要是去网上找些工具和代码,发现了<a href="http://code.google.com/apis/ajaxfeeds/" target="_blank">google ajax feed api</a>这样个好东西.其中的<a href="http://www.google.com/uds/solutions/dynamicfeed/index.html" target="_blank">AJAX Dynamic Feed Control</a>可以直接在网页中调用.</p>
<p>简单介绍2个实例,具体可以去google上看看.以下代码开头中的key=notsupplied-wizard这段在实际使用中请改成具体的<a href="http://code.google.com/apis/ajaxsearch/signup.html" target="_blank">google API key</a>.</p>
<p><strong>1.第一个比较简洁,列出RSS的标题和简洁,可以添加多个RSS. <a href="http://www.molezz.net/wiki/doku.php/%E7%BD%91%E7%BB%9C%E6%8A%80%E6%9C%AF/google-ajax-feed-api-1" target="_blank">效果见这</a>.</strong><br />
<span id="more-221"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.google.com/jsapi?key=notsupplied-wizard&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span> 
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> 
google<span style="color: #339933;">.</span>load<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;feeds&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">function</span> initialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
<span style="color: #000000; font-weight: bold;">var</span> feedControl <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> google<span style="color: #339933;">.</span>feeds<span style="color: #339933;">.</span>FeedControl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
feedControl<span style="color: #339933;">.</span>addFeed<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://feed.feedsky.com/molezz&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;molezz BAR&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
feedControl<span style="color: #339933;">.</span>addFeed<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://feed.feedsky.com/molezz&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;molezz BAR2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
feedControl<span style="color: #339933;">.</span>draw<span style="color: #009900;">&#40;</span>document<span style="color: #339933;">.</span>getElementById<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;feedControl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span> 
google<span style="color: #339933;">.</span>setOnLoadCallback<span style="color: #009900;">&#40;</span>initialize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span> 
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;feedControl&quot;</span><span style="color: #339933;">&gt;</span>Loading<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

<p><strong>2.第二个比较花哨,有动态效果,也可以添加多个RSS,<a href="http://www.molezz.net/wiki/doku.php/%E7%BD%91%E7%BB%9C%E6%8A%80%E6%9C%AF/google-ajax-feed-api-2" target="_blank">效果见这</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;feed-control&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>span style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;color:#676767;font-size:11px;margin:10px;padding:4px;&quot;</span><span style="color: #339933;">&gt;</span>Loading<span style="color: #339933;">...&lt;/</span>span<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;!--</span> Google Ajax Api
  <span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.google.com/jsapi?key=ABQIAAAAYyAcC_2-AB_-d2frcEenJhT_l7btg2vey3SF4xrWe8eMrDUaihT1d3ADiu199b_6prRFCyRUi-QoAQ&quot;</span>
    type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;!--</span> Dynamic Feed Control and Stylesheet <span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js&quot;</span>
    type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">@</span>import url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">function</span> LoadDynamicFeedControl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">var</span> feeds <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
	<span style="color: #009900;">&#123;</span>title<span style="color: #339933;">:</span> <span style="color: #0000ff;">'molezz BAR'</span><span style="color: #339933;">,</span>
	 url<span style="color: #339933;">:</span> <span style="color: #0000ff;">'http://feed.feedsky.com/molezz'</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#123;</span>title<span style="color: #339933;">:</span> <span style="color: #0000ff;">'molezz BAR 2'</span><span style="color: #339933;">,</span>
	 url<span style="color: #339933;">:</span> <span style="color: #0000ff;">'http://feed.feedsky.com/molezz'</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        stacked <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        horizontal <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        title <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;Google feed api实例2&quot;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">new</span> GFdynamicFeedControl<span style="color: #009900;">&#40;</span>feeds<span style="color: #339933;">,</span> <span style="color: #0000ff;">'feed-control'</span><span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// Load the feeds API and set the onload callback.</span>
    google<span style="color: #339933;">.</span>load<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'feeds'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    google<span style="color: #339933;">.</span>setOnLoadCallback<span style="color: #009900;">&#40;</span>LoadDynamicFeedControl<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></pre></div></div>

<p>更多设置参数详见<a href="http://www.google.com/uds/solutions/dynamicfeed/reference.html" target="_blank">google文档.</a>另外这个实例中的外观也可以自己写css进行替换.</p>
<img src="http://www.molezz.net/?ak_action=api_record_view&id=221&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.molezz.net/drink/google-ajax-feed-api-sample/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
