<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atomfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="0.3" xml:lang="zh-tw">
  <title>薄荷 Ajax <!--tag--></title>
  <link rel="alternate" type="text/html" href="http://blog.yuan.cc/ck/archives/it/web/ajax/" />
  <modified>2007-02-26T09:07:21Z</modified>
  <tagline>這裡沒有 IT 文了....</tagline>
  <id>tag:blog.yuan.cc,2008:/ck/4</id>
  <generator url="http://www.movabletype.org/" version="3.2">Movable Type</generator>
  <copyright>Copyright (c) 2007, yuan</copyright>
  <link rel="start" type="application/atom+xml" href="http://feeds.feedburner.com/Ajax" /><feedburner:info uri="ajax" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><entry>
    <title>我看「部落格外掛不單純」</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/XUPJwmWqfdk/post_42.html" />
    <modified>2007-02-26T09:07:21Z</modified>
    <issued>2007-02-26T16:22:57+08:00</issued>
    <id>tag:blog.yuan.cc,2007:/ck/4.3075</id>
    <created>2007-02-26T08:22:57Z</created>
    <summary type="text/plain">今天看了「部落格外掛不單純」一文, 讓我想起之前寫的舊文萬惡的 Javascript. 沒錯, Mybloglog 的確可以去偷 AdSense 的資料. 其實, 掛在同一個網頁下的 Javascript 外掛, 不但可以互相偷資料, 還可以 reuse 對方的 code, 更可以 replace 對方的 code. 不然各式各樣的 API 是怎麼運作的? (eg. Google Maps, Flickr... ). Ajax 玩過火就會有安全上得隱憂的....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Security</category>
            <category>Web</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>今天看了「<a href="http://blog.yam.com/ixblog/article/8441947">部落格外掛不單純</a>」一文, 讓我想起之前寫的舊文<a href="http://blog.yuan.cc/ck/archives/2005/09/_javascript_par.html">萬惡的 Javascript</a>. </p>

<p>沒錯, Mybloglog 的確可以去偷 AdSense 的資料. 其實, 掛在同一個網頁下的 Javascript 外掛, 不但可以互相偷資料, 還可以 reuse 對方的 code, 更可以 replace 對方的 code. 不然各式各樣的 API 是怎麼運作的? (eg. Google Maps, Flickr... ). Ajax 玩過火就會有安全上得隱憂的. </p>]]>
      
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2007/02/post_42.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo 小改版與 Ajax 小技巧分享</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/nlUzllEXk9s/ajax_hacking_rojo_ajax.html" />
    <modified>2005-12-27T20:03:49Z</modified>
    <issued>2005-12-28T03:33:24+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1910</id>
    <created>2005-12-27T19:33:24Z</created>
    <summary type="text/plain">今天對這支 Ajax Wrapper for Rojo 的 Greasemonkey script 小改版了, 原因是一些非同步的問題. GM script 是在整頁 HTML 載入, 並且執行完 body onload 的動作之後才執行. 但是要 hacking Ajax 的網站時常遇到的問題是, 原始網站的 script 經常還沒有跑完, 就輪到自己的 GM script 上場了. 如果你要 hacking 以載入的 HTML elements 那倒還好, 如果要 hacking 對方的 script,...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Greasemonkey</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>今天對這支 <a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro.html">Ajax Wrapper for Rojo</a> 的 Greasemonkey script 小改版了, 原因是一些非同步的問題. </p>

<p>GM script 是在整頁 HTML 載入, 並且執行完 body onload 的動作之後才執行. 但是要 hacking Ajax 的網站時常遇到的問題是, 原始網站的 script 經常還沒有跑完, 就輪到自己的 GM script 上場了. 如果你要 hacking 以載入的 HTML elements 那倒還好, 如果要 hacking 對方的 script, 那就麻煩大了, 這是非同步難處理的地方. </p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/rojo.ajax.user.js">AJAX Wrapper for Rojo v1.6</a>.</p>]]>
      <![CDATA[<p>自從 <a href="http://blog.yuan.cc/ck/archives/2005/11/firefox_15_released.html">Firefox 1.5</a> 之後, 不知道是 <a href="http://www.rojo.com/">Rojo</a> 自己的 script 越來越龐大, 還是 Firefox 執行 script 的順序改變或速度變慢, 這支將 Rojo Ajax 化的 script 竟然屢次都跑的比 Rojo 主站的 script 還快. 於是我去偷換 Rojo 中 Remote.execRequest 這個 function 就一直失敗. (註: 偷換他的原因是因為 <a href="http://blog.yuan.cc/ck/archives/2005/08/hacking_rojo_ro.html">Rojo 不是用真正 Ajax 的 XMLHttpRequest, 而是用背景用 iframe 偷傳資料</a>).</p>

<p>漂亮的解法應該用一些 event linster 來做, 尤其要 hacking GMail 之流的網站更須如此, 否則 HTML Dom 變來變去, 要 inject dom elements 怎麼辦得到? 但這次就偷懶一下吧, 用個 Javascript Loop 來測試就好了. :p</p>

<p>分享一下寫法:</p>

<pre class="console">
w.ajaxize = function() {
    if( w.Remote == undefined ) return;
    else clearInterval(ajax_handler);
    w.Remote.execRequest = function(resource, callback, callbackArguments) {
        -- ignore --
    }
}
var ajax_handler = setInterval("ajaxize()", 500);
</pre>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/12/ajax_hacking_rojo_ajax.html</feedburner:origLink></entry>
  <entry>
    <title>TWD67 與 TWD97 的座標轉換</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/C2HkvCx7DwA/twd67_twd97.html" />
    <modified>2005-12-16T00:14:28Z</modified>
    <issued>2005-12-16T01:17:26+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1875</id>
    <created>2005-12-15T17:17:26Z</created>
    <summary type="text/plain">為了實作出 GM Script: UrMap + Google Maps 的功能, 遭遇到的第一個問題便是座標基準 (Datum) 的不同. 故事是這樣的: - TWD67: 台灣內政部在 1997 年之前的舊的 Datum 座標基準 - TWD97: 台灣內政部在 1997 年公告之新的座標基準 - UrMap 用的是 TWD67, 並且是以 TM2 (二度分帶) 座標數值 (詳見此文) - Google Maps 用的是 WGS84, 並且是經緯度數值 (LatLon,...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Maps</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>為了實作出 <a href="http://blog.yuan.cc/ck/archives/2005/12/gm_script_urmap_google_maps.html">GM Script: UrMap + Google Maps</a> 的功能, 遭遇到的第一個問題便是座標基準 (Datum) 的不同</a>. </p>

<p>故事是這樣的:</p>

<p>- TWD67: 台灣內政部在 1997 年之前的舊的 Datum 座標基準<br />
- TWD97: 台灣內政部在 1997 年公告之新的座標基準<br />
- UrMap 用的是 TWD67, 並且是以 TM2 (二度分帶) 座標數值 (詳見<a href="http://blog.yuan.cc/ck/archives/2005/12/urmap_1.html">此文</a>)<br />
- Google Maps 用的是 WGS84, 並且是經緯度數值 (LatLon, <a href="http://life.csu.edu.au/geo/dms.html">D.d 格式</a>)<br />
- TWD97 與 WGS84 幾乎是相同的, 僅相差數公分 (詳見<a href="http://jidanni.org/geo/taiwan_datums/pshung.html">此文</a>)</p>

<p>因此要將 Google Maps 嵌入到 UrMap 以方便做兩者地圖與衛星圖的比對, 必須進行座標轉換. 轉換的方式如下:</p>

<pre class="console">TWD67(TM2) -> TWD97(TM2) -> TWD97(LatLon) </pre>]]>
      <![CDATA[<h2>TWD67(TM2) -> TWD97(TM2)</h2>

<p>這部份我用的是在網路上找到的簡易算法 (<a href="http://gis.thl.ncku.edu.tw/coordtrans/coordtrans.aspx">成功大學水工試驗所大地坐標轉換測試程式</a>)</p>

<blockquote>

<p>TWD67<->TWD97 二度分帶二維坐標轉換公式:<br />
A= 0.00001549<br />
B= 0.000006521<br />
X67 = X97 - 807.8 - A * X97 - B * Y97<br />
Y67 = Y97 + 248.6 - A * Y97 - B * X97<br />
X97 = X67 + 807.8 + A * X67 + B * Y67<br />
Y97 = Y67 - 248.6 + A * Y67 + B * X67<br />
PS.僅適用於台灣本島，最大誤差約二公尺,精密測量不適用!</p>

</blockquote>

<p>註: 該作者稱最大誤差約兩公尺, 但我自己估<a href="http://blog.yuan.cc/ck/archives/2005/12/urmap_google_maps.html">測約有十公尺左右的誤差</a>.</p>

<h2>TWD97(TM2) -> TWD97(LatLon)</h2>

<p>這部份我使用的是 <a href="http://www.remotesensing.org/proj/">PROJ.4</a>, 這是一套 Unix 下 open source 的座標投影轉換程序 (cartesian coordinates <-> geographic longitude and latitude coordinates). 可以互轉二度分帶 (TM2) 與經緯座標 (LatLon).</p>

<h2>API Web Service</h2>

<p>因為座標轉換是要用在 GM script 中, 必須以 Ajax 的方式達成. 網路上找到的 TWD67/TWD97 間的轉換工具, 大多是 Web 的 form 介面, 或是 .exe 執行檔, 要在 Javascript 上應用很不方便. 再者 PROJ.4 是 Unix 上的 library, 因此對我而言這項轉換在 Server Side 較容易實作. </p>

<p>既然要支援 Ajax 的方式, 以 Web Service API 的程式介面來提供轉換服務. 我用的是 REST 的簡單格式:</p>

<div style="background:#e6ecf2;padding:10px">
<strong>REST Endpoint URL</strong>: http://webdev.yuan.cc/maps/twd_conv.php

<p><strong>Arguments</strong>:<br />
   - method (Required): TWD67TOTWD97 or TWD97TOTWD67<br />
   - x (Required): x value in TM2 <br />
   - y (Required): y value in TM2 </p>

<p><strong>Example</strong>: http://webdev.yuan.cc/maps/twd_conv.php?method=TWD67TOTWD97&x=301822.41&y=2769934.13</p>

<p><strong>Response</strong>:</p>

<p><iframe width=450 height=500 src="http://webdev.yuan.cc/maps/twd_conv.php?method=TWD67TOTWD97&x=301822.41&y=2769934.13"></iframe><br />
</div></p>

<p>其他參考資料: <a href="http://jidanni.org/geo/taiwan_datums/">Taiwan 衛星定位系統 GPS and 座標轉換 TWD67, TWD97, WGS84 coordinate transformations</a></p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/12/twd67_twd97.html</feedburner:origLink></entry>
  <entry>
    <title>GM Script: UrMap + Google Maps</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/THkWcyyRbkU/gm_script_urmap_google_maps.html" />
    <modified>2005-12-12T18:24:30Z</modified>
    <issued>2005-12-13T01:27:27+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1866</id>
    <created>2005-12-12T17:27:27Z</created>
    <summary type="text/plain"> 完工了!! 我把 UrMap 和 Google Maps 這兩家線上電子地圖送做堆了. :) 這支 Greasemonkey script 可以將 Google Maps 整合到 UrMap 中, 自動調整 GMaps 的中心座標以對應目前 UrMap 的中心座標, 並且調到相當的 zoom level. 此外, 在地圖的右上角會即時顯示目前中心座標, 還提供轉換座標為 TWD97 的功能. 之前提到 UrMap 的新操作介面以 Ajax 達成, 使得在 Web 瀏覽地圖變得非常的流暢. UrMap...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Google</category>
            <category>Greasemonkey</category>
            <category>Maps</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/72874251/" title="Photo Sharing"><img src="http://static.flickr.com/20/72874251_0332c3eba2_m.jpg" width="234" height="240" alt="UrMap   Google Maps" align="left" style="margin-right:5px" /></a></p>

<p>完工了!! 我把 <a href="http://www.urmap.com/">UrMap</a> 和 <a href="http://maps.google.com/">Google Maps</a> 這兩家線上電子地圖送做堆了. :)</p>

<p>這支 Greasemonkey script 可以將 Google Maps 整合到 UrMap 中, 自動調整 GMaps 的中心座標以對應目前 UrMap 的中心座標, 並且調到相當的 zoom level. 此外, 在地圖的右上角會即時顯示目前中心座標, 還提供轉換座標為 TWD97 的功能. <br />
<br clear=all><br />
<a href="http://blog.yuan.cc/ck/archives/2005/12/urmap.html">之前提到 UrMap 的新操作介面</a>以 Ajax 達成, 使得在 Web 瀏覽地圖變得非常的流暢. <a href="http://www.urmap.com/">UrMap</a> 也提供豐富的地理資訊, 這是 <a href="http://maps.google.com/">Google Maps</a> 目前在台灣所沒有的. 但是 <a href="http://maps.google.com/">Google Maps</a> 的優點是有比較清晰的衛星照片, 他的 zoom in level 比 <a href="http://www.urmap.com/">UrMap</a> 還多一級 (100m), 但 <a href="http://www.urmap.com/">UrMap</a> 有全台灣各地相同解析度的衛星照片, 而 <a href="http://maps.google.com/">Google Maps</a> 只有人口密集的都會區才有高解析度照片, 各有優劣之處. 除此之外, <a href="http://maps.google.com/">Google Maps</a> 是開放的平台, 有提供 API, 可以自行開發各種應用. 因此整合兩家線上地圖, 可以讓我們對台灣有更清楚的 view.</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/urmap.gmaps.user.js">urmap.gmaps.user.js</a></p>]]>
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/72874184/" title="Photo Sharing"><img src="http://static.flickr.com/35/72874184_515c004b63.jpg" width="450" height="458" alt="UrMap Taipei" /></a><br />
先用 UrMap 找到要瀏覽的地區, 上圖是中正紀念堂的衛星照.</p>

<p><a href="http://www.flickr.com/photos/ckyuan/72874267/" title="Photo Sharing"><img src="http://static.flickr.com/34/72874267_2ed2a9fc00.jpg" width="450" height="57" alt="UrMap and Google Maps" /></a><br />
在的地圖上方, 會有一個 Google Maps 的按鈕, 可以打開 Google Maps, 並移動到目前 UrMap 的中心座標. 右上角功能列有 "Convert to TWD97" , 可以將<a href="http://blog.yuan.cc/ck/archives/2005/12/urmap_1.html">目前 UrMap 的 TM2 座標</a>轉換成 TWD97.</p>

<p><a href="http://www.flickr.com/photos/ckyuan/72874218/" title="Photo Sharing"><img src="http://static.flickr.com/35/72874218_9946edebd4.jpg" width="450" height="456" alt="UrMap and Google Maps" /></a><br />
開啟後, 就會看到 Google Maps 所提供此區域的衛星照. Google Maps 的衛星照片會非常貼近 UrMap 的, 但是在接近的比例尺下, UrMap 的景物會略大. 而 Google Maps 可再 zoom in 一級來看到更清晰的畫面.</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/12/gm_script_urmap_google_maps.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - Clearance of All Additions</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/-8iqeLLRjXk/ajax_hacking_rojo_clearance_of_all_additions.html" />
    <modified>2005-12-25T05:34:44Z</modified>
    <issued>2005-11-25T03:26:44+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1907</id>
    <created>2005-11-24T19:26:44Z</created>
    <summary type="text/plain"> I have been adding some additions to Rojo and keeping this script updated with Rojo. Lately, Rojo slightly changed its HTML layout, so some features of the script failed. I also fixed the compatible problem with Firefox 1.5RC3. Following...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Greasemonkey</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/66539334/" title="Photo Sharing"><img src="http://static.flickr.com/25/66539334_a68ed351c2.jpg" width="500" height="236" alt="Rojo - all in one" /></a></p>

<p>I have been adding some additions to Rojo and keeping this script updated with Rojo. Lately, Rojo slightly changed its HTML layout, so some features of the script failed. I also fixed the compatible problem with Firefox 1.5RC3. Following is the clearance of all additions to Rojo of this script.</p>

<ol><li><a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro.html">an Ajax Wrapper for Rojo</a> - replace the remote scripting by iframe request with XMLHttpRequest</li><li><a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_2.html">'Mark as Read' to each feed</a> - mark the entire feed as read</li><li><a href="http://blog.yuan.cc/ck/archives/2005/09/ajax_hacking_ro_3.html">'Mark as Read' to each article</a> - mark the article as read</li><li><a href="http://blog.yuan.cc/ck/archives/2005/09/ajax_hacking_ro_4.html">A toggle to display feed profile</a> - fetch and display the profile of the feed</li><li><a href="http://blog.yuan.cc/ck/archives/2005/10/ajax_hacking_ro_5.html">Quick unsubscribing feeds</a> -  at the left hand side of feeds navigation and below each article</li><li><font size=0.8em color=red>new</font> Read all stories - add 'Read All' after 'Expand All' and 'Collapse All' </li></ol>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/rojo.ajax.user.js">AJAX Wrapper for Rojo v1.5</a>. (Greasemonkey script)</p>]]>
      
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/11/ajax_hacking_rojo_clearance_of_all_additions.html</feedburner:origLink></entry>
  <entry>
    <title>Web 設計與 Greasemonkey 雜談</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/oDIxEinV2e4/web_greasemonke.html" />
    <modified>2005-12-25T05:18:32Z</modified>
    <issued>2005-11-08T15:08:24+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1630</id>
    <created>2005-11-08T07:08:24Z</created>
    <summary type="text/plain">使用者介面設計很重要, 不僅攸關網站門面的觀感, 也關係到運作的效能 - 包括系統與使用者操作上的效能. 一些好的快捷功能應該提供在頁面上, 避免一直切換網頁, 有些已經開啟的 Web 元件, 可以透過 Ajax 重複利用的, 不要笨笨的刷新頁面. 除非這個網站潛在目的上要讓使用者不停的逛大街來增加廣告曝光度, 否則要經過三個以上的 link 才能找到想找的功能是不智的. 注重系統效能是要降低經營者的軟硬體成本, 注重使用者操作效率是要提供更好的人機介面, 不然大家是會轉台的....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Greasemonkey</category>
            <category>Rojo</category>
            <category>Web</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>使用者介面設計很重要, 不僅攸關網站門面的觀感, 也關係到運作的效能 - 包括系統與使用者操作上的效能. 一些好的快捷功能應該提供在頁面上, 避免一直切換網頁, 有些已經開啟的 Web 元件, 可以透過 Ajax 重複利用的, 不要笨笨的刷新頁面. 除非這個網站潛在目的上要讓使用者不停的逛大街來增加廣告曝光度, 否則要經過三個以上的 link 才能找到想找的功能是不智的. 注重系統效能是要降低經營者的軟硬體成本, 注重使用者操作效率是要提供更好的人機介面, 不然大家是會轉台的.</p>]]>
      <![CDATA[<p>我想 GM script writer 大多是很注重 user friendly 的程式設計師, 一方面嫌棄別人的介面搞的不順手, 於是就動手開始改. 當然這不是 GM 全部的用途, 還有不少的目的是為了「破解」一些被藏在網頁背後的好東西. 最近幾個知名網站都在小改版, 每次一有小改版, 這些 GM Scripts 就特別容易出錯. 因為 GM script 本來就是貼著目前的 HTML DOM 來東加西減的, DOM 稍有變動, script 出錯的機會非常大.</p>

<p>Flickr 新增的功能最多. 像 Set 裡多了一些貼心功能, 譬如排列相片順序, Batch Edit 等, 不需要進 Organize 就可以進行. 還有 Lock thread, replace photo 和 printing service  等等.</p>

<p>我常用的 Rojo 也在小改, 但似乎顯得有點力不從心, 常常出槌. 有進步的地方是 Recommended Links,  去 整理統計出來那些 link 最多文章提到; 還有在閱讀單一 feed 的時候可以直接對那個 feed 加 tag, 這不是什麼了不起的功能, 但是 Rojo 搞了很久才修好. 但在 FF 之下卻把 Expand/Collapse All 的功能給搞壞了. 我寫的 <a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro.html">Hacking Rojo script</a> 常常出錯, 隔天又自己變好, 就知道 Rojo 背後有東西在修改, 而且通常是還沒改好就急著上線. 但是 Rojo 對 feed/article 組織管理上的理念不錯, 但是在 Web-based Reader 的架構設計上太差, 資料庫效能看來也不是很好, 以後有空再聊. </p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/11/web_greasemonke.html</feedburner:origLink></entry>
  <entry>
    <title>Yahoo! Maps Beta Released</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/2j_6UAOiHnM/yahoo_maps_beta.html" />
    <modified>2005-11-04T19:42:41Z</modified>
    <issued>2005-11-05T02:42:09+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1611</id>
    <created>2005-11-04T18:42:09Z</created>
    <summary type="text/plain"> Yahoo 終於推出了新的 Maps beta 服務, 讓人眼睛一亮. 為了不讓 Google Maps 與 MSN Virtual Earth 專美於前, Yahoo 大幅改進了舊版地圖, 推出了 Maps Beta. 一樣是要著重於使用者操作介面, 無論是拖拉地圖, 放大縮小都變得跟 Google Maps 一樣方便. 不同之處在於, Yahoo! Maps Beta 用的是 Flash, 所以對地圖操作可以提供更細緻的滑鼠控制, 但可惜的是目前只有美國地圖, 也沒有衛星照片. 但真正讓人驚豔的是.........</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Google</category>
            <category>Maps</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a title="Yahoo! Maps, by ckyuan" href="http://www.flickr.com/photos/ckyuan/59614641/"><img src="http://static.flickr.com/26/59614641_a41808fa4f_m.jpg" width="240" height="145"></a></p>

<p>Yahoo 終於推出了新的 Maps beta 服務, 讓人眼睛一亮. </p>

<p>為了不讓 <a href="http://blog.yuan.cc/ck/archives/2005/06/google_maps.html">Google Maps</a> 與 <a href="http://blog.yuan.cc/ck/archives/2005/07/msn_virtual_ear.html">MSN Virtual Earth</a> 專美於前, Yahoo 大幅改進了舊版地圖, 推出了 Maps Beta. 一樣是要著重於使用者操作介面, 無論是拖拉地圖, 放大縮小都變得跟 Google Maps 一樣方便. 不同之處在於, Yahoo! Maps Beta 用的是 Flash, 所以對地圖操作可以提供更細緻的滑鼠控制, 但可惜的是目前只有美國地圖, 也沒有衛星照片. </p>

<p>但真正讓人驚豔的是......</p>]]>
      <![CDATA[<p>真正讓人驚豔的是 <a href="http://developer.yahoo.net/maps/index.html">Yahoo! Maps Developer APIs</a> 不同於 Google 或 MSN, Yahoo! 直接提供三種 API 模式: <a href="http://ws1.inf.scd.yahoo.com/maps/simple/index.html">Yahoo! Maps Simple API</a>, <a href="http://ws1.inf.scd.yahoo.com/maps/flash/index.html">Yahoo! Maps Flash APIs</a>, 和 <a href="http://ws1.inf.scd.yahoo.com/maps/ajax/index.html">Yahoo! Maps AJAX API</a>. <a href="http://developer.yahoo.net/">Yahoo! Developer Network</a>  這次所提供的 Web Application Solutions 一應俱全, 技壓群雄. 同樣的地圖圖檔服務, 開發技術任君選擇. 並且還有更震撼的 Building Block Components: </p>

<ul><li><a href="http://ws1.inf.scd.yahoo.com/maps/rest/V1/geocode.html">Geocoding API</a>: 提供地址來找經緯座標的 API 服務</li><li><a href="http://ws1.inf.scd.yahoo.com/maps/rest/V1/mapImage.html">Map Image API</a>: 提供經緯度或地址來取回地圖的圖檔! 這不得了, 手機業者會愛死這功能! 之前有人 hack google maps 半天才解出 GMaps 的圖檔規則, Yahoo! 這回全部奉送.</li><li><a href="http://ws1.inf.scd.yahoo.com/traffic/index.html">Traffic APIs</a>: 提供某地點的即時交通資訊</li><li><a href="http://ws1.inf.scd.yahoo.com/search/local/">Local Search APIs</a>: 查詢 Yahoo! Local Service. 這應該不用多解釋了吧.</li></ul>

<p>無怪乎 Geobloggers 的作者 Rev Dan Catt <a href="http://geobloggers.blogspot.com/2005/11/yahoo-maps-flash-api-killer-app-for.html">稱 Yahoo! Maps 這次是 Killer App 了</a>. 而 Geobloggers 的動作還真快, 已經馬上改用 Yahoo! Maps API 改寫好了, 可由此處去瞧瞧 <a href="http://www.geobloggers.com/yindex.cfm">Yahoo 版的 Geobloggers</a>.</p>

<p>我想 Yahoo! 大概看了大家 <a href="http://blog.yuan.cc/ck/archives/2005/06/about_google_ma.html">Hacking Google Maps</a> 的過程, 心裡大概有數, 只要是以泛 Ajax 來提供服務(client side computing), 大概免不了遲早要被 hack. 與其讓大家 hacking, 乾脆主動把所有 Web Service APIs 先招了. 這也可以帶動 third party 應用的快速出現. 看來, 競爭線上地圖服務 (even Web 2.0) 的火藥味還真是濃厚啊!</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/11/yahoo_maps_beta.html</feedburner:origLink></entry>
  <entry>
    <title>更新 Super Batch Script (支援 FF1.5 &amp; 相片置頂)</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/C2CFtB0zpKY/_super_batch_sc.html" />
    <modified>2005-10-30T11:17:58Z</modified>
    <issued>2005-10-30T18:04:20+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1589</id>
    <created>2005-10-30T10:04:20Z</created>
    <summary type="text/plain">這支 GM script: Super Batch Processing for Flickr 有幾個更新與加強的地方: 在 menu 裡加了 'update script' , 方便更新 script.加了相片 'Move to Top' 的功能, 其實就是把在 cart 裡的相片修改 posted date 到目前時間, 於是就相片就可以「置頂」了.支援 Firefox 1.5Beta2 + GM 0.6.2 ps. 相片置頂功能需要你的電腦時間誤差不能太大, 原則上是把相片 posted date 設成 (now...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Firefox</category>
            <category>Flickr</category>
            <category>Greasemonkey</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>這支 <a href="http://blog.yuan.cc/ck/archives/2005/10/gm_script_super.html">GM script: Super Batch Processing for Flickr</a> 有幾個更新與加強的地方:</p>

<ol><li>在 menu 裡加了 'update script' , 方便更新 script.</li><li>加了相片 'Move to Top' 的功能, 其實就是把在 cart 裡的相片修改 posted date 到目前時間, 於是就相片就可以「置頂」了.</li><li>支援 Firefox 1.5Beta2 + GM 0.6.2</li></ol>

<p>ps. 相片置頂功能需要你的電腦時間誤差不能太大, 原則上是把相片 posted date 設成 (now - 5min). Flcikr 不接受 posted date 設成未來時間.</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/flickr.batch.user.js">flickr.batch.user.js</a></p>]]>
      
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/10/_super_batch_sc.html</feedburner:origLink></entry>
  <entry>
    <title>GM script: Super Batch Processing for Flickr</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/ejQ3gp3-OQ8/gm_script_super.html" />
    <modified>2005-10-29T06:00:15Z</modified>
    <issued>2005-10-29T11:07:27+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1582</id>
    <created>2005-10-29T03:07:27Z</created>
    <summary type="text/plain"><![CDATA[ Flickr is lacking of creating a list of arbitrary photos for batch operations. This script provides a &quot;shopping cart&quot; for you to collect your photos to process. After you added a number of photos in cart, you can edit...]]></summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Flickr</category>
            <category>Greasemonkey</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/56509898/"><img src="http://static.flickr.com/24/56509898_91326689f3_m.jpg" width="240" height="174" alt="Super Batch Tool" /></a></p>

<p>Flickr is lacking of creating a list of arbitrary photos for batch operations. This script provides a &quot;shopping cart&quot; for you to collect your photos to process. After you added a number of photos in cart, you can edit as a batch, make an album, a slideshow, or a mosaic. Items in cart will be saved in greasemonkey storage and will be remembered while you're visiting different pages in flickr.</p>

<p>Features:<br />
<ol><li>A cart to collect photos you select, up to 100 photos</li><li>A checkbox attached on the upper-right corner of each photo</li><li>Editing photos as a batch, beyond sets, tagged photos, or date-based photos</li><li>Connecting to external flickr tools, such as <a href="http://webdev.yuan.cc/famaker.php">Flcikr Album Maker</a>, <a href="http://flagrantdisregard.com/flickr/mosaic.php">Photo Mosaic</a>, or <a href="http://flagrantdisregard.com/flickr/slideshow.php">Slideshow</a>.</li><li>Working fine with &quot;<a href="http://flickr.com/groups/flickrhacks/discuss/28750/">GM: Batch Enhancer</a>&quot;</li></ol></p>

<p>Special thanks to <a href="http://flickr.com/photos/john/">fd (John)</a> for his permission to feed the list of photos to his <a href="http://flagrantdisregard.com/flickr/">flickr toys</a>. (slideshow and mosaic)</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/flickr.batch.user.js">flickr.batch.user.js</a></p>]]>
      <![CDATA[<p>這是貼在 <a href="http://www.flickr.com/groups/flickrhacks/discuss/110122/">Flcikr Hacks</a> 裡的. 不過要推一下 Goston 已經幫我做了<a href="http://goston.blogspot.com/2005/10/flickr-greasemonkey-script-for-flickr.html">圖文並茂的說明</a>. 不過看到別人比我自己還早公布在 blog 還真有點怪.  :)</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/10/gm_script_super.html</feedburner:origLink></entry>
  <entry>
    <title>GM script: Ajax Photo Blogging in Flickr (v 0.1)</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/9SNboahd8FU/gm_script_ajax.html" />
    <modified>2006-07-21T07:49:24Z</modified>
    <issued>2005-10-25T22:32:56+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1570</id>
    <created>2005-10-25T14:32:56Z</created>
    <summary type="text/plain"> I've written a new GM script called "Ajax Photo Blogging." It's not an improved version of official "Blog this" tool, instead, I create a new one in Ajax approach to let you blog faster and easier. The features of...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Code</category>
            <category>Flickr</category>
            <category>Greasemonkey</category>
            <category>MT</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/54557426/"><img src="http://static.flickr.com/32/54557426_b66b9ad911_m.jpg" width="167" height="240" alt="Ajax Photo Blogging" /></a></p>

<p>I've written a new GM script called "Ajax Photo Blogging." It's not an improved version of official "Blog this" tool, instead, I create a new one in Ajax approach to let you blog faster and easier.</p>

<p>The features of the tool:<br />
<ol><li>Blogging and posting in Ajax way in background.</li><li>Posting to your blog via XMLRPC by calling GMxmlhttpRequest of greasemonkey.</li><li>Using MetaWeblog API. Working fine and testing in Movable Type 3.2 now.</li><li>Adding the URL of new post to the photo description or comment, depend on if you are the owner of photo or not.</li></ol></p>

<p>The pros -<br />
<ol><li>No need to save your blog password in Flickr.</li><li>Blogging and commenting at one-click.</li></ol></p>

<p>The cons -<br />
<ol><li>Storing your blog password in local machine causes inconvenience when not using your own computer.</li><li>You need to know the detail tech info of your blog, eg. XMLRPC endpoint URL, blogid...</li></ol></p>

<p>I only test under my blog environment now. Mine is Movable Type 3.2. I believe all MT series will work fine. If any of you are interested in this script, please have a try and let me know the result. Your feedback is appreciated.</p>

<p>ps. The pieces of code to add comment and description are contributed by steeev in my <a href="http://www.flickr.com/groups/flickr_tools/discuss/65253/">GMiF project</a>. Thank you.</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/flickr.blog.user.js">flickr.blog.user.js</a><br />
Discussion: <a href="http://www.flickr.com/groups/flickrhacks/discuss/106719/">Flickr Hacks Group</a> in Flickr</p>]]>
      <![CDATA[<p><script>document.location='http://flickr.tw/2005/10/gm_script_ajax_photo_blogging_in_flickr_v_01.html';</script></p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/10/gm_script_ajax.html</feedburner:origLink></entry>
  <entry>
    <title>Worm 2.0 and MySpace</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/BusNtkRqyPA/worm_20_and_mys.html" />
    <modified>2005-10-15T15:00:46Z</modified>
    <issued>2005-10-15T13:32:52+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1410</id>
    <created>2005-10-15T05:32:52Z</created>
    <summary type="text/plain">從忙裡偷閒的國三生那兒看到這篇 Web 2.0，Worm 2.0, 原來已經有 Ajax 寫的 Worm 開始流傳了. 看了作者自己解釋的原理, 發現到其實 MySpace 其實在防堵這些 malicious tags/scripts 的地方還蠻多的, 但作者竟然都一一突圍, 成功的執行了他要執行的 code. 而從他的 code 還可以學到不少撇步. :)...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Security</category>
            <category>Web</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>從<a href="http://blog.ijliao.info/">忙裡偷閒的國三生</a>那兒看到這篇 <a href="http://blog.ijliao.info/archives/2005/10/14/1833/">Web 2.0，Worm 2.0</a>, 原來已經有 Ajax 寫的 Worm 開始流傳了. 看了作者<a href="http://namb.la/popular/tech.html">自己解釋的原理</a>, 發現到其實 MySpace 其實在防堵這些 malicious tags/scripts 的地方還蠻多的, 但作者竟然都一一突圍, 成功的執行了他要執行的 code. 而從他的 code 還可以學到不少撇步. :) </p>]]>
      <![CDATA[<p>其實現在越來越多的 BSP, 社群網站, 交友網站都開放寫一些自己的 profile, journal, comments, 尤其是 Blog 服務又必須開放 Javascript, 因為有很多人會在 sidebar 放網摘, 留言, Flickr flash, 天氣, 反向連結等一些 script-based 的小玩具. 而同一家的用戶又通常是處於已經登入或保持登入的狀態, 一旦瀏覽到某個含有 malicious codes 的其他用戶資料或文章, 那麼任何開啟連回同一個 domain 的 HTTP Request 都會帶著 session cookies, 也就可以寫一段 Javascript 做一些事, 並擁有對方使用者的權限. </p>

<p>今天在瀏覽器端 Javascript 能作的事兒實在太多, 基本上模擬一個使用者去操作 Web 介面是完全可行的, 一旦在瀏覽器端的 script 能夠開始執行, 大概就擋不了什麼了, 而如果又是在 logged on 的狀態, 使用者權限能做的事大概都能夠做. 所以第一關要防堵的就是不讓使用者 inject 能夠被 invoke 的 script. MySpace 當然不允許使用者 script, 作者的方法是在 &#60;div&#62; style 的 background url 裡塞進 script. 果然令人意想不到.</p>

<p>看了之後的心得是, <a href="http://blog.yuan.cc/ck/archives/2005/09/_javascript_par.html">萬惡的 Javascript</a> 能幹的壞事兒又添了不少.</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/10/worm_20_and_mys.html</feedburner:origLink></entry>
  <entry>
    <title>Scriptlet of Yahoo Site Explorer</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/O_yNfj4eIXM/scriptlets_for.html" />
    <modified>2005-10-10T06:54:35Z</modified>
    <issued>2005-10-10T01:12:43+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1397</id>
    <created>2005-10-09T17:12:43Z</created>
    <summary type="text/plain">Blog 越來越多之後, Blog Search 這個市場開始變得重要了. 搜尋 Blog 除了傳統搜尋網頁內文外, 由於 Blog 社會化的特性, 搜尋相互間的連結是 Blog Search 的一大特色. 比較知名的有 Technorati, IceRocket, Google Blog Search 等. Yahoo 前陣子也推出了 Yahoo Site Explorer, 雖然在名稱上沒提到要專門伺候 Blog, 而是專門處理 link 的資訊與 links 之間的關係, 也算是符合 Blog Search 的需要. What is...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Code</category>
            <category>Web</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>Blog 越來越多之後, Blog Search 這個市場開始變得重要了. 搜尋 Blog 除了傳統搜尋網頁內文外, 由於 Blog 社會化的特性, 搜尋相互間的連結是 Blog Search 的一大特色. 比較知名的有 <a href="http://www.technorati.com/">Technorati</a>, <a href="http://blogs.icerocket.com/">IceRocket</a>, <a href="http://blogsearch.google.com/">Google Blog Search</a> 等. Yahoo 前陣子也推出了 <a href="http://siteexplorer.search.yahoo.com/">Yahoo Site Explorer</a>, 雖然在名稱上沒提到要專門伺候 Blog, 而是專門處理 link 的資訊與 links 之間的關係, 也算是符合 Blog Search 的需要.</p>

<blockquote><a href="http://siteexplorer.search.yahoo.com/siteexplorer/learnmore#WhatIs">What is Yahoo! Site Explorer?</a>

<p>The Yahoo! search database contains detailed information about the structure of the web. In addition to the web pages themselves, the database stores information about links among pages, and uses that information (as well as additional algorithms) to gauge the popularity of a given page.</p>

<p>Site Explorer gives you access to this information so you can learn about a site. To explore a site, you submit a URL using a search box, just as you would for a normal web search. You can then click links on the results page to see detailed information.</blockquote></p>

<p>我試用了這幾個重要的搜尋服務中, 似乎只有 <a href="http://siteexplorer.search.yahoo.com/">Yahoo Site Explorer</a> 有提供比較像樣的 <a href="http://developer.yahoo.net/search/siteexplorer/">Web Services API</a>. 我利用 Yahoo 這個 API 寫了一個 Scriptlet, 可以嵌在任何網頁中, 透過 Yahoo API 搜尋所有連至該網頁的 inbound links. 這個 Scriptlet 以類似 Ajax 的方式在背景呼叫 API, 傳回結果顯示在 Scriptlet 嵌入的位置. 有興趣者歡迎試用.</p>]]>
      <![CDATA[<p>這支 scriptlet 的特色是完全 client side, 不需要 server 端安裝任何東西, 以似 Ajax 的方式運作, 搜尋的時候在背景進行, 不會影響原始網頁的載入速度. 使用方法很簡單, 只要在網頁中希望出現結果的地方插入下面這段 code 即可.</p>

<pre class="console">
&#60script src="http://webdev.yuan.cc/search/siteexplorer.js"&#62
&#60/script&#62
</pre>

<p>搜尋結果會放在一個 &#60div&#62 內, &#60div&#62 的 id 是 "Yahoo_Site_Explorer", 所以您可以用 CSS 自訂呈現的樣式. 範例如下:</p>

<pre class="console">
#Yahoo_Site_Explorer {
   width: 200px;
   padding: 5px;
   border: 1px solid #FFFFFF;
   color: #333;
}
#Yahoo_Site_Explorer span:hover {
   color: #36414d; 
   text-decoration: underline; 
}
</pre>

<p>安裝好之後, 在你的網頁會出現 "Click to Search via Yahoo Site Explorer..." 的文字, 按一下這段文字就會開始搜尋. 如果想要網頁載入後自動開始搜尋, 請將網頁或 Blog 模版的 &#60body&#62 改成下列的寫法:</p>

<pre class=console>
&#60body onload="YuanCC.search()"&#62
</pre>

<p>實際的範例在本站右邊的 sidebar 可以看到. 這支 script 寫的時候遇到一些 Firefox 與 IE 相容性的問題, 並且還要應付 XMLHttpRequest 的安全性問題, 所以程式有點雜亂. 歡迎大家測試, 如果使用上遇到任何問題請隨時告知. 下一篇會詳細介紹調整這支 script 的一些參數, 如搜尋等待時間, 指定搜尋網址, 傳回搜尋結果筆數等.<br />
</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/10/scriptlets_for.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Ajax 的兩面刃</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/C3OzTUzcO0A/ajax_ajax_1.html" />
    <modified>2005-10-09T17:44:50Z</modified>
    <issued>2005-10-09T23:12:35+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1396</id>
    <created>2005-10-09T15:12:35Z</created>
    <summary type="text/plain">Ajax 顯然已經是個引發熱潮的 Web 技術. 儘管是舊技術的重新包裝, 但是靠著定義新名詞來聚焦討論與關注, 對 IT 評論者而言有無限的想像空間, 對開發者而言也可以重新思考以改進 Web 設計架構與技巧的技術. Ajax 開啟了 Web Application 的新思維, 小從 Flickr 將相片加入 Photo Set 或 Group 的使用介面改進, 大到 Google Maps, GMail 等獨立的 Web 應用程式, 都是 Ajax 的設計方法....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>IT</category>
            <category>Web</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>Ajax 顯然已經是個引發熱潮的 Web 技術. 儘管是舊技術的重新包裝, 但是靠著定義新名詞來聚焦討論與關注, 對 IT 評論者而言有無限的想像空間, 對開發者而言也可以重新思考以改進 Web 設計架構與技巧的技術. Ajax 開啟了 Web Application 的新思維, 小從 <a href="http://www.flickr.com/">Flickr</a> 將相片加入 Photo Set 或 Group 的使用介面改進, 大到 <a href="http://maps.google.com/">Google Maps</a>, <a href="http://gmail.google.com/">GMail</a> 等獨立的 Web 應用程式, 都是 Ajax 的設計方法. </p>]]>
      <![CDATA[<p>但 Ajax 是把兩面刃, 一面砍向了傳統桌面軟體, 尤其是以 Office 為收入大宗的微軟. Ajax 拉近了 Web Application 與 Desktop Application 的距離, 譬如像 <a href="http://www.writely.com/">Writely</a> 是一個 Ajax 的 Web based 的線上文書編輯器, 像 <a href="http://numsum.com/">Num Sum</a> 就是一個 Web based 的試算表. 想想每個人電腦裡安裝的 Office, 有多少功能是用不到的? 也許不久之後會有更多功能更完整的 Ajax Office 網路服務出現, 可能會侵蝕一部份大而不當的桌面軟體市場, 而安裝單機版 MS Office 也會顯得越來越不重要.</p>

<p>而 Ajax 的另一面砍向了 Ajax 網站自身. Ajax 是先天的 Open Source, 採用 Ajax 的網站都等於無條件的將原始碼奉送給大眾. 以 Ajax 為主要網頁呈現技術的網路服務, 必須自己有不可取代的核心資訊在背後, 否則 Ajax 無非就是一張建築藍圖, 一五一十的告訴外界設計上的秘密. 透過藍圖, 任何人都可以取得網站背後所提供的資訊, 無論有沒有開放 API, 業餘開發者甚至競爭對手都可以取得伺服器端的資料. <a href="http://maps.google.com/">Google Maps</a> 的 hacking 和 <a href="http://www.flickr.com/">Flickr</a> 與 <a href="http://gmail.google.com/">GMail</a> 的一堆 Greasemonkey scripts 就是個例子.<br />
</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/10/ajax_ajax_1.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - Quick unsubscribe feeds in Rojo</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/oLaAv-dpefQ/ajax_hacking_ro_5.html" />
    <modified>2005-12-25T05:16:21Z</modified>
    <issued>2005-10-02T01:37:00+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1368</id>
    <created>2005-10-01T17:37:00Z</created>
    <summary type="text/plain"> In Rojo, you can unsubscribe feeds only within two pages, the page of managing your feed list or the one of viewing the feed profile. Now the rojo.ajax.user.js script injects quick links to let you unsubscribe feeds any time....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Greasemonkey</category>
            <category>RSS</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/48323822/" title="Photo Sharing"><img src="http://static.flickr.com/31/48323822_907d0fc886.jpg" width="457" height="111" alt="Quick unsubscribe feeds in Rojo" /></a></p>

<p>In Rojo, you can unsubscribe feeds only within two pages, the page of managing your feed list or the one of viewing the feed profile. Now the rojo.ajax.user.js script injects quick links to let you unsubscribe feeds any time. The response time of unsubscription is very fast due to the calling to unpublished Rojo API (RPC). :)</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/rojo.ajax.user.js">AJAX Wrapper for Rojo v1.4</a>. (Greasemonkey script)</p>]]>
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/48323807/" title="Photo Sharing"><img src="http://static.flickr.com/30/48323807_0b92fd4156.jpg" width="251" height="259" alt="Rojo - quick unsub feed" align=left style="margin-right:5px" /></a></p>

<p>In the left hand side of feeds navigation, there's a new icon <img src="unsub.gif" /> heading each feed. You can click the icon to unsubscribe the corresponding feed.</p>

<p>Beside, in the list of stories, there's an additional link next to "Mark this feed as Read". You can also click to unsubscribe the feed.</p>

<p><br clear=all><br />
Previous articles: <br />
<a href="http://blog.yuan.cc/ck/archives/2005/09/ajax_hacking_ro_4.html">[Ajax] Hacking Rojo - Adding bits to feeds in Rojo</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/09/ajax_hacking_ro_3.html">[Ajax] Hacking Rojo - Ajaxize more of 'Mark as Read'</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_2.html">[Ajax] Hacking Rojo - Ajaxize 'Mark as Read' function</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_1.html">[Ajax] Hacking Rojo - Slow Response of Rojo</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro.html">[Ajax] Hacking Rojo - an Ajax Wrapper for Rojo</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/hacking_rojo_ro.html">[Ajax] Hacking Rojo - Rojo is not Ajax?</a></p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/10/ajax_hacking_ro_5.html</feedburner:origLink></entry>
  <entry>
    <title>Web 2.0 根本不存在</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/dAUcv3vfvtA/web_20.html" />
    <modified>2005-09-17T08:10:05Z</modified>
    <issued>2005-09-15T17:07:11+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1340</id>
    <created>2005-09-15T09:07:11Z</created>
    <summary type="text/plain">來個聳動的標題吧, 反正這年頭流行這樣下標題! 越來越看不懂一堆人整天鬼扯的 Web 2.0 了. 每次網路上一有什麼新玩意兒, 就開始想像一個新的時代來到了, 好像 Internet 會從此脫胎換骨似的, 是不是成天玩網路的人都有先天過份樂觀症候群? 看到異想天開寫了Web 3.0, 讓我笑了好久. 我想應該直接飆車到 Web 5.0 or Web XP 比較過癮點.</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>IT</category>
            <category>Web</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>來個聳動的標題吧, 反正這年頭流行這樣下標題!</p>

<p>越來越看不懂一堆人整天鬼扯的 Web 2.0 了. 每次網路上一有什麼新玩意兒, 就開始想像一個新的時代來到了, 好像 Internet 會從此脫胎換骨似的, 是不是成天玩網路的人都有先天過份樂觀症候群? 看到<a href="http://www.oui-blog.com/balduran/">異想天開</a>寫了 <a href="http://www.oui-blog.com/balduran/archives/007594.html">Web 3.0</a>, 讓我笑了好久. 我想應該直接飆車到 Web 5.0 or Web XP 比較過癮點.</p>]]>
      <![CDATA[<p>眾所皆知 Web 2.0 只是虛幻的口號, 搞技術的人根本不來這套. 只有一些缺乏技術質量的人, 才會把 Web 程式設計用上的一些小小伎倆當成革命, 把一些看似互動性高, 社會性強的網站奉為圭臬. 說穿了, 只不過是一些軟體設計常見的原則罷了, 只不過是 Client/Server 架構下一些工作量的重新分配, 只不過是 User Interface 的重新設計. Web 2.0 最大的用處, 就是去騙資金, 耍的投資人團團轉, 彷彿 Internet 又要掀起什麼一波什麼樣的革命. 這幾年彷彿都是這麼玩的, 其實很少有精彩的發明出現, 像是什麼 Blogosphere, RSS, Ajax, 六度分離, 一堆名詞, 也不就是那麼回事. </p>

<p>也許是大家悶久了, 總要創些名詞來說說嘴, Ajax 是還算好的, 雖然沒有新鮮貨, 至少有個明確的定義. Web 2.0 連個定義都是模糊的, 只看到一堆人只好開始用舉例的方式說這是 web 2.0 , 這是 web 1.0, 那不是 web 2.0 諸如此類的, 只會以分類法來定義新名詞, 卻又說不清個所以然. 那我來給個定義好了, 管你有沒有互動, 管你是不是 Ajax, 管你是不是 Read/Write, 管你是不是去中心化, <u>凡是能幫我聚集人氣能賺大錢的網站, 通通叫做 Web 2.0</u>!  這不就得了?</p>

<p>我始終覺得這是 Blog 風行以後的後遺症, 說話的人多了, 就聽不清真相了. 專家說話也不聽, 每個人都有自己的詮釋, 大家都爭著說話, 說一些言不及義的五四三. 最令人憂心的就是炒熱了一個名詞, 而這個名詞卻沒有實質定義與內涵, 然後卻成為了投資者的重要參考依據; 就像台灣一窩瘋的蓋 BSP 一樣, 每天電視新聞下面的跑馬燈就開始跑主播部落格的網址, 每家報紙也都跑出部落格, 然後台灣的網路業者也都很糟, 都沒什麼創新理念, 只會跟在人家屁股後面.</p>

<p>最好 Web 2.0 不要給我弄進教科書去, 否則我絕對要去靜坐抗議!</p>

<p>碎碎念完了. <br />
</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/09/web_20.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - Adding bits to feeds in Rojo</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/M63p9sVR76Q/ajax_hacking_ro_4.html" />
    <modified>2005-12-25T05:15:49Z</modified>
    <issued>2005-09-14T13:03:46+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1337</id>
    <created>2005-09-14T05:03:46Z</created>
    <summary type="text/plain"> Rojo is lacking of some designs of user friendly. Why am I saying that? Sometimes we need to make an unnecessary click to get some basic but useful information of a feed. While reading stories of a feed, we...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Greasemonkey</category>
            <category>RSS</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/43219309/" title="Photo Sharing"><img src="http://static.flickr.com/29/43219309_c96d109fce_m.jpg" width="178" height="240" alt="Rojo - Feed Profile" align=left style="margin-right:5px" /></a></p>

<p>Rojo is lacking of some designs of user friendly. Why am I saying that? Sometimes we need to make an unnecessary click to get some basic but useful information of a feed. While reading stories of a feed, we probably want to take a look at the profile of it, or we also need to link to its original site. Furthermore, we would like to know the number of subscribers, unsubscribe, or rename the feed. All the stuff is in the profile of the feed, and need a click to get it. <br />
<br clear=all><br />
The worse is still the slow response of Rojo. Loading a new page requires not only to fetch from server, but also needs extra time for browsers to render it. Now the script <strong>rojo.ajax.user.js v1.3</strong> adds some bits to it. It fetches the profile of the feed in background, then displays a toggle below the title of feed. Click the toggle will show the information on the feed in Ajax way. </p>

<p>Download: AJAX Wrapper for Rojo v1.3 <a href="http://webdev.yuan.cc/greasemonkey/rojo.ajax.user.js">rojo.ajax.user.js</a></p>]]>
      <![CDATA[<p>Technically, this is not an Ajax. I didn't fetch XML data from Rojo server. The data structure I can exploit in the HTML pages of Rojo is not much. Rojo didn't release API like Flickr or Google Maps, the only way to hack Rojo is to dive into its scripts. But this time I use an ugly way to reach my goal. I actually don't need XML, so I get the HTML page by calling XMLHttpRequest instead of XML data. I only need to parse the HTML text to get the piece of code about the profile and insert into current DOM tree.</p>

<p>Previous articles: <br />
<a href="http://blog.yuan.cc/ck/archives/2005/09/ajax_hacking_ro_3.html">[Ajax] Hacking Rojo - Ajaxize more of 'Mark as Read'</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_2.html">[Ajax] Hacking Rojo - Ajaxize 'Mark as Read' function</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_1.html">[Ajax] Hacking Rojo - Slow Response of Rojo</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro.html">[Ajax] Hacking Rojo - an Ajax Wrapper for Rojo</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/hacking_rojo_ro.html">[Ajax] Hacking Rojo - Rojo is not Ajax?</a><br />
</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/09/ajax_hacking_ro_4.html</feedburner:origLink></entry>
  <entry>
    <title>Tags in LfVr</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/Tr2NgPq1Azo/tags_in_lfvr.html" />
    <modified>2005-09-13T00:35:07Z</modified>
    <issued>2005-09-13T07:44:18+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1334</id>
    <created>2005-09-12T23:44:18Z</created>
    <summary type="text/plain"> 應使用者建議, 把 LfVr 的 tags 顯示改成這樣....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Flickr</category>
            <category>LfVr</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/42822194/" title="Photo Sharing"><img src="http://static.flickr.com/32/42822194_b451ec1ed6_m.jpg" width="240" height="163" alt="Tags in LfVr" /></a></p>

<p>應使用者建議, 把 <a href="http://webdev.yuan.cc/lfvr/">LfVr</a> 的 tags 顯示改成這樣.</p>]]>
      
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/09/tags_in_lfvr.html</feedburner:origLink></entry>
  <entry>
    <title>GM Script: UDN Ajax News Loader</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/6Ke6zbsZmFA/gm_script_udn_a.html" />
    <modified>2005-09-16T21:13:35Z</modified>
    <issued>2005-09-08T12:40:24+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1314</id>
    <created>2005-09-08T04:40:24Z</created>
    <summary type="text/plain"> 這是一個 Greasemonkey script 可以把聯合新聞網改成 Ajax 的方式來載入新聞. 不必再重新載入整個 HTML 頁面. 雖然 UDN 的廣告都已經被我清除乾淨, 速度已經很快了, 但是這個 Ajax 的小實驗還是很有趣的. 方法就是用 XMLHttpRequest 來載入新的新聞 HTML 檔, 然後截出新聞本體的部分來取代現在的頁面. 實驗後可以證明, 一個網站的速度, 跟全頁載入的效率很有關係. 這牽涉到網頁設計用到的元件, 如要載入的圖形或 Embed/Plugin, 還有頁面 Layout 的複雜性等等. 如果一個以新聞資訊為主體的網站在每次轉換頁面都需要重複載入這些元件並且重新 Rendering 頁面, 那浪費的時間是不少的. 目前這個 script 能處理的 UDN...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Greasemonkey</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/41355756/" title="Photo Sharing"><img src="http://static.flickr.com/23/41355756_17d2850f20_m.jpg" width="240" height="185" alt="Ajaxized UDN.com" /></a></p>

<p>這是一個 <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> script 可以把<a href="http://udn.com/">聯合新聞網</a>改成 Ajax 的方式來載入新聞. 不必再重新載入整個 HTML 頁面. 雖然 <a href="http://udn.com/">UDN</a> 的廣告都已經被我清除乾淨, 速度已經很快了, 但是這個 Ajax 的小實驗還是很有趣的. 方法就是用 XMLHttpRequest 來載入新的新聞 HTML 檔, 然後截出新聞本體的部分來取代現在的頁面. 實驗後可以證明, 一個網站的速度, 跟全頁載入的效率很有關係. 這牽涉到網頁設計用到的元件, 如要載入的圖形或 Embed/Plugin, 還有頁面 Layout 的複雜性等等. 如果一個以新聞資訊為主體的網站在每次轉換頁面都需要重複載入這些元件並且重新 Rendering 頁面, 那浪費的時間是不少的. </p>

<p>目前這個 script 能處理的 UDN 新聞有國內要聞, 兩岸國際, 及地方新聞三大類. 要用 Ajax 載入新聞時請按新聞標題前新增的這個小 icon <img src="http://webdev.yuan.cc/images/ajaxload.gif" style="vertical-align:middle" />.</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/udn.ajax.user.js">udn.ajax.user.js</a></p>]]>
      <![CDATA[<p>其實 Ajax 有很多變形, 像這裡用的 XMLHttpRequest 就不一定是要抓 XML 回來處理不可. 之前寫的 <a href="http://blog.yuan.cc/ck/archives/2005/08/flickr_comments.html">Flickr Comments in your blog</a> 則不使用 XMLHttpRequest, 而是直接用 Append Script Child in DOM Tree 來達成, 在精神上都是 Asynchronous Data Retrieval.</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/09/gm_script_udn_a.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - Ajaxize more of 'Mark as Read'</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/v6FnCaMfb0Y/ajax_hacking_ro_3.html" />
    <modified>2005-12-25T05:12:07Z</modified>
    <issued>2005-09-06T08:31:41+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1311</id>
    <created>2005-09-06T00:31:41Z</created>
    <summary type="text/plain"> Last time I have Ajaxized a 'Mark as Read' on a single feed to move the HTTP request to background by calling XMLHttpRequest instead of bringing to a new page. The counters of unread entries are reset on LHS...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Code</category>
            <category>Greasemonkey</category>
            <category>RSS</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/40660783/" title="Photo Sharing"><img src="http://static.flickr.com/32/40660783_9e7ad61b21.jpg" width="420" height="225" alt="Rojo - mark as read" /></a></p>

<p>Last time I have Ajaxized a 'Mark as Read' on a single feed to move the HTTP request to background by calling XMLHttpRequest instead of bringing to a new page. The counters of unread entries are reset on LHS menu. This time I extend the work to each single story and the feed below the story entry. That means you can now mark a story read as well as the feed of a story. See the screenshot above.</p>

<p>For each story, you can now do expand/collapse, mark as read, or both on it. For the feed of a story, you can also mark it read. This makes you much easier to mark a feed read without going to the page of that feed. </p>

<p>Download: AJAX Wrapper for Rojo v1.2 <a href="http://webdev.yuan.cc/greasemonkey/rojo.ajax.user.js">rojo.ajax.user.js</a></p>]]>
      <![CDATA[<p>Previous articles: <br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_2.html">[Ajax] Hacking Rojo - Ajaxize 'Mark as Read' function</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_1.html">[Ajax] Hacking Rojo - Slow Response of Rojo</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro.html">[Ajax] Hacking Rojo - an Ajax Wrapper for Rojo</a><br />
<a href="http://blog.yuan.cc/ck/archives/2005/08/hacking_rojo_ro.html">[Ajax] Hacking Rojo - Rojo is not Ajax?</a></p>

<p>Blogs talking about this:<br />
<a href="http://codinginparadise.org/weblog/2005/08/someone-hacked-rojo-using-greasemonkey.html"> Someone Hacked Rojo Using Greasemonkey!</a><br />
<a href="http://www.connectedinternet.co.uk/blog/_archives/2005/8/26/1172000.html">Speed up Rojo using GreaseMonkey- Firefox Users only</a></p>

<p>Related Articles:<br />
The Blog Herald - <a href="http://www.blogherald.com/2005/09/14/rojo-reviewed/">Rojo reviewed</a></p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/09/ajax_hacking_ro_3.html</feedburner:origLink></entry>
  <entry>
    <title>Icerocket 的 Link Tracker</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/MvT8_A5RDLg/icerocket_link.html" />
    <modified>2005-10-03T12:45:56Z</modified>
    <issued>2005-09-04T19:34:01+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1304</id>
    <created>2005-09-04T11:34:01Z</created>
    <summary type="text/plain">在 gslin 那兒看到介紹 Icerocket, 雖然之前有聽說過, 但是看到這個 Link Tracker 才引起我的興趣. 簡單說就是可以幫你計算你的網頁有多少其他的網頁 link 到你, 然後做一個 link 連去 Icerocket 搜尋這些 citations. 很快的裝了一下, 又看了 gslin 遇到這個問題, 實在覺得 Icerocket 提供 scriptlet 的方法有點畫蛇添足....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Code</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>在 <a href="http://blog.gslin.org/archives/2005/09/03/93/">gslin 那兒</a>看到介紹 <a href="http://www.icerocket.com/">Icerocket</a>, 雖然之前有聽說過, 但是看到這個 <a href="http://www.icerocket.com/c?p=linktracker">Link Tracker</a> 才引起我的興趣. 簡單說就是可以幫你計算你的網頁有多少其他的網頁 link 到你, 然後做一個 link 連去 Icerocket 搜尋這些 citations.</p>

<p>很快的裝了一下, 又看了 gslin 遇到<a href="http://blog.gslin.org/archives/2005/09/03/94/">這個問題</a>,  實在覺得 Icerocket 提供 scriptlet 的方法有點畫蛇添足. </p>]]>
      <![CDATA[畫蛇添足的原因是, 既然要別人用一段 remote Javascript, 然後又硬要作得像 Ajax 般使用 XMLHttpRequest, 逼的非裝 php 的 proxy cit_client.php 不可. 既然用戶可以用 php, 又何必非要弄個 Javascript 來動態塞回 Linking post 的數字, 裝的很像 Ajax. 如果你看不懂我的繞口令, 那就是...真的不懂, 也不必往下看了. :)
<p>
其實那 Icerocket 提供的 web service 就是下面這樣.
<p>
<pre class="console">
http://blogs.icerocket.com/citations.php?f=text
&q=http://blog.yuan.cc/ck/</pre>

<p>傳回的內容不是正統 Ajax 的 XML, 而是一段 HTML. 看來要應用應該不是那麼複雜.</p>

<p>我改寫了 Icerocket 的 cit_client.php, 讓事情簡單點. </p>

第一種方法是寫一支 cit_client_js.php
<pre class="console">&#60;&#63;
$q = isset($_GET['q'])?$_GET['q']:"";
$str = file_get_contents( 
    "http://blogs.icerocket.com/citations.php?f=text&q="
    .urlencode($q));
echo "document.write(\"$str\");\n";
&#63;&#62;
</pre>

<p>用法: </p>
<pre class="console">&#60;script
 src="http://blog.yuan.cc/cit_client_js.php?q=http://blog.yuan.cc/ck/"&#62;
&#60;/script&#62;</pre>
<p>結果就直接在這裡 --> <script src="http://blog.yuan.cc/cit_client_js.php?q=http://blog.yuan.cc/ck/"></script>
把 script 直接塞到要放 "54 Linking Posts" 的位置去就好了.</p>

<p>第二個是寫一支 cit_client_dom.php</p>
<pre class="console">&#60;&#63;
header('Content-type: application/x-javascript');
$q = isset($_GET['q'])?$_GET['q']:"";
$ref = isset($_GET['ref'])?$_GET['ref']:"";
$str = file_get_contents(
    "http://blogs.icerocket.com/citations.php?f=text&q="
    .urlencode($q));
echo "$ref.innerHTML = \"$str\";\n";
&#63;&#62;</pre>

<p>用法一: </p>
<pre class="console">&#60;script 
src="http://blog.yuan.cc/cit_client_dom.php?ref=elm&q=http://blog.yuan.cc/ck/"&#62;
&#60;/script&#62;</pre>

<p>用法二: </p>
<pre class="console">&#60;script&#62; 
    var elm = document.getElementById('elm');
    var js = document.createElement("script");
    js.language = "javascript";
    js.src = "http://blog.yuan.cc/cit_client_dom.php?ref=elm&q=http://blog.yuan.cc/ck/";
    document.body.appendChild(js);
&#60;/script&#62;
</pre>

<p>這是比較高級的應用, 如果你的 blog 有用到一些複雜的 DHTML 時這會很方便. 就是先把 DOM Element 的 reference 抓到(getElementById) 或造出來 (createElement), element 的 reference 是 elm, 然後傳給 cit_client_dom.php, 之後這個就會 elm.innerHTML 就會被塞進 "54 Linking Posts" 這玩意兒了. 比較常用的 container 可以是 &#60;p&#62;, &#60;span&#62; 兩種.</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/09/icerocket_link.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - Ajaxize 'Mark as Read' function</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/5wRo_PFLGK8/ajax_hacking_ro_2.html" />
    <modified>2005-12-25T05:10:19Z</modified>
    <issued>2005-08-20T17:28:00+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1257</id>
    <created>2005-08-20T09:28:00Z</created>
    <summary type="text/plain">Since my previous work 'an Ajax Wrapper for Rojo' has replaced the iframe remote scripting by XMLHttpRequest, some slow 'loading whole page' transactions of Rojo need remodeling now. Well, I use the term "Ajaxize" which means turning the old-fashioned transactions...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Code</category>
            <category>Greasemonkey</category>
            <category>RSS</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>Since my previous work '<a href="http://blog.yuan.cc/ck/archives/001251.html">an Ajax Wrapper for Rojo</a>' has replaced the iframe remote scripting by XMLHttpRequest, some slow 'loading whole page' transactions of Rojo need remodeling now. Well, I use the term "Ajaxize" which means turning the old-fashioned transactions of cross-pages into Ajax approach. The first one I've done is to make "Mark as Read" as a background transaction. </p>

<p>The script 'rojo.ajax.user.js' is now version 1.1 and has the following features:</p>

<p>
1. Override the Remote object(remote scripting) by an Ajax wrapper.
2. Mark as read is now Ajax and reset the unread count on the LHS menu.</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/rojo.ajax.user.js">rojo.ajax.user.js</a></p>]]>
      <![CDATA[<p>The code is simple. Just 'click' the 'Mark as Read' url by XMLHttpRequest, and then reset the counter in LHS menu.</p>

<pre class="console">
Ajax.Mark_as_Read = function() {

    var markasread = document.getElementById("markReadLink");
    if( markasread ) {
        var url = markasread.href;
        markasread.href = 'javascript:;';
        var callback = function() {
            var li = document.getElementsByTagName('li');
            for(var i=0; i &#60; li.length; i++) {
                if( li[i].className == 'selected subscription unread' ) {
                    li[i].getElementsByTagName('span')[0].innerHTML = '';
                }
            }
        }
        markasread.onclick = function() {
            Remote.execRequest(url, callback, null);
        }
    }
}
</pre>
]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_2.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - Slow Response of Rojo</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/ZyE-O3hyJnA/ajax_hacking_ro_1.html" />
    <modified>2005-12-25T05:06:34Z</modified>
    <issued>2005-08-19T18:46:16+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1252</id>
    <created>2005-08-19T10:46:16Z</created>
    <summary type="text/plain">我仍然極為喜愛 Rojo 簡潔的畫面與 Tag 的功能, 很有質感又兼具方便的資料彙整與社群分享功能. 但在使用上有時的回應速度仍然相當的慢. 仔細看了 Rojo 網站架構與程式碼之後, 發現 Rojo 在設計上仍有改進的空間. 讓使用者覺得一個網路服務慢的原因可能有很多, 需要一一攤開來分析. 在此不討論計算能量, 網站頻寬等硬體相關的因素, 只把焦點放在架構設計與使用介面上....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Greasemonkey</category>
            <category>IT</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>我仍然極為喜愛 <a href="http://www.rojo.com/">Rojo</a> 簡潔的畫面與 Tag 的功能, 很有質感又兼具方便的資料彙整與社群分享功能. 但在使用上有時的回應速度仍然相當的慢. 仔細看了 <a href="http://www.rojo.com/">Rojo</a> 網站架構與程式碼之後, 發現 <a href="http://www.rojo.com/">Rojo</a> 在設計上仍有改進的空間. 讓使用者覺得一個網路服務慢的原因可能有很多, 需要一一攤開來分析. 在此不討論計算能量, 網站頻寬等硬體相關的因素, 只把焦點放在架構設計與使用介面上. </p>]]>
      <![CDATA[<p>我很好奇的是, <a href="http://www.rojo.com/">Rojo</a> 既然使用了 DHTML/Javascript/CSS 來設計網站, 又為何用了 <a href="http://developer.apple.com/internet/webcontent/iframe.html">Remote Scripting with iFrame</a>, 而不採 XMLHttpRequest 的方式來達成 Asynchronous Data Retrieval 呢? 也許是為了相容更舊的瀏覽器吧. </p>

<p>但是撇開 Remote Scripting, 另一個慢的原因是在架構設計, 和使用者介面採用的 Ajax 還不夠多所導致. 簡單說, 就是頁面切換次數太頻繁. 每一次的切換網頁(網址會改變) 就是要連回 HTTP 伺服器重新產製一次頁面, 這包含了資料庫查詢, 建立該頁面左側的 feeds 清單, 以及頁面中間的 entries 清單. 中間的 Entries 清單可不只是標題, 還有 entry 的內容都一併傳回, 這個動作可以擱置到後來以 on-demand 的方式來取回, 應該可以加速不少. 其次是有太多的操作上的功能應該以 Ajax 的方式來完成, 譬如 Mard as Read,  Show Read & Unread, 都是 Ajax 的強項, 要多多利用才是.</p>

<p><a href="http://blog.yuan.cc/ck/archives/001251.html">上篇我簡單寫了一個 Wrapper</a>, 以 Ajax 來取代 Remote Scripting 的 <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> script. 能改善的效能有限, 原因就在於太多的功能需要重新連回伺服器做頁面轉換. 其實, 很多地方都可以 Ajax 來達成, 既快速又省頻寬.</p>

<p>補記: <br />
呵呵, 發現<a href="http://www.dancemoon.net/?p=149">不是我一人嫌 Rojo 慢</a>....</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro_1.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - an Ajax Wrapper for Rojo</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/t8CX9DjrvXw/ajax_hacking_ro.html" />
    <modified>2005-12-25T05:05:00Z</modified>
    <issued>2005-08-18T19:36:20+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1251</id>
    <created>2005-08-18T11:36:20Z</created>
    <summary type="text/plain">Rojo is a great web-based RSS reader. It supports tagging not only feeds but also article entries. The user interface is neat and well organized. The use of DHTML and CSS makes the site easier reading and more accessible. As...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Code</category>
            <category>Greasemonkey</category>
            <category>IT</category>
            <category>RSS</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.rojo.com/">Rojo</a> is a great web-based RSS reader. It supports tagging not only feeds but also article entries. The user interface is neat and well organized. The use of DHTML and CSS makes the site easier reading and more accessible.</p>

<p>As we already knew, <a href="http://www.rojo.com/">Rojo</a> uses a lot of DHTML + Javascript techniques to enhance the user interface. Despite Rojo has the modern design of tagging and social share, it seems not to be an Ajax approach I talked in my previous post, "<a href="http://blog.yuan.cc/ck/archives/001250.html">Hacking Rojo - Rojo is not Ajax?</a> ". <a href="http://www.rojo.com/">Rojo</a> retrieve asynchronous data by remote scripting with iframe, not by calling XMLHttpRequest. There would be a little bit slower when using remote script instead of XMLHttpRequest. Therefore I did a small experiment to replace the iframe remote script by the Ajax way. The <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> user script can meet my need to override the methods of Remote object in Rojo.</p>

<p>This <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> user script is a wrapper for <a href="http://www.rojo.com/">Rojo</a> to replace its iframe request by the XMLHttpRequest function. The data retrivial will proceed in background, so the browser won't be seen in loading pages any more. After installing the script, the response of using <a href="http://www.rojo.com/">Rojo</a> should become faster.</p>

<p>Download: <a href="http://webdev.yuan.cc/greasemonkey/rojo.ajax.user.js">rojo.ajax.user.js</a></p>]]>
      <![CDATA[<p>Let's take a look at the two original methods of Remote object.</p>

<pre class="console">
Remote.execRequest = function(resource, callback, callbackArguments) {
    //NOTE: we need to prevent corruption here due to multi-threaded IO and
    //non-blocking UI controls in IE/Mozilla

    this.callback = callback;
    this.callbackArguments = callbackArguments;
    this.waitingForResponse = true;
    this.changeIFrameLocation(resource);
}

Remote.iFrameOnLoad = function() {

    if ( this.callback != null ) {
        var currentCallback = this.callback;
        var currentCallbackArguments = this.callbackArguments;
        this.callback = null;
        this.callbackArguments = null;
        this.resource = null;
        this.waitingForResponse = false;
        if (this.requests.length > 0) {
            var nextRequest = Util.shift(this.requests);
            this.waitingForResponse = true;
            this.execRequest(nextRequest.resource, nextRequest.callback,
                             nextRequest.callbackArguments);
        }
        var iframeContents = Remote.getIFrameContents();
        if (currentCallbackArguments == undefined ||
            currentCallbackArguments == null) {
            currentCallbackArguments = new Array();
        }
        currentCallbackArguments[currentCallbackArguments.length] = iframeContents;
        currentCallback.apply(null, currentCallbackArguments);
    }
}
</pre>

<p>Now we can override the above two methods by the following new methods with a real Ajax XMLHttpRequest call.</p>

<pre class="console">
Remote.fakeiFrameOnLoad = function(result) {
    if ( this.callback != null ) {
        var currentCallback = this.callback;
        var currentCallbackArguments = this.callbackArguments;
        this.callback = null;
        this.callbackArguments = null;
        this.resource = null;
        this.waitingForResponse = false;
        if (this.requests.length > 0) {
            var nextRequest = Util.shift(this.requests);
            this.waitingForResponse = true;
            this.execRequest(nextRequest.resource, nextRequest.callback, nextRequest.callbackArguments);
        }

        var iframeContents = result;
        if (currentCallbackArguments == undefined || currentCallbackArguments == null) {
            currentCallbackArguments = new Array();
        }
        currentCallbackArguments[currentCallbackArguments.length] = iframeContents;
        currentCallback.apply(null, currentCallbackArguments);
    }
}

Remote.execRequest = function(resource, callback, callbackArguments) {
    this.callback = callback;
    this.callbackArguments = callbackArguments;
    this.waitingForResponse = true;
//    this.changeIFrameLocation(resource);

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState==4) {
            if (xmlhttp.status==200) Remote.fakeiFrameOnLoad(xmlhttp.responseText);
        }
    }
    xmlhttp.open('GET', resource, true);
    xmlhttp.send(null);
}
</pre>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/08/ajax_hacking_ro.html</feedburner:origLink></entry>
  <entry>
    <title>[Ajax] Hacking Rojo - Rojo is not Ajax?</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/PUjBGdrXeFA/hacking_rojo_ro.html" />
    <modified>2005-12-25T05:03:11Z</modified>
    <issued>2005-08-18T13:22:40+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1250</id>
    <created>2005-08-18T05:22:40Z</created>
    <summary type="text/plain"> 之前說到開始嘗試 Rojo, 試用了幾天之後有一些心得. 優點: 最大的好處還是 Tag. :) Rojo 可以 tag feeds, 對於 feeds 很多的人是一大福音. Rojo 也可以為單篇文章加 tag, 這適合做保存文摘, 也可以方便去搜尋別人 tag 的相關文章.介面設計上有些 DHTML 的互動, 不牽涉 data retrieval 時的操作速度可以加快. 缺點: Rojo 對中文的支持有點問題, 如果不小心加了中文的 tag, 訂閱的 feed 會無法刪除 tag, 而且左邊的 tag 列表裡的中文...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>IT</category>
            <category>RSS</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/35003899/" title="Photo Sharing"><img src="http://photos23.flickr.com/35003899_a9e5ee4674_m.jpg" width="240" height="218" alt="Rojo" /></a></p>

<p>之前說到<a href="http://blog.yuan.cc/ck/archives/001242.html">開始嘗試 Rojo</a>, 試用了幾天之後有一些心得.</p>

<p>優點: <br />
<ol><li>最大的好處還是 Tag. :) <a href="http://www.rojo.com/">Rojo</a> 可以 tag feeds, 對於 feeds 很多的人是一大福音. </li><li>Rojo 也可以為單篇文章加 tag, 這適合做保存文摘, 也可以方便去搜尋別人 tag 的相關文章.</li><li>介面設計上有些 DHTML 的互動, 不牽涉 data retrieval 時的操作速度可以加快.</li></ol></p>

<p>缺點:<br />
<ol><li><a href="http://www.rojo.com/">Rojo</a> 對中文的支持有點問題, 如果不小心加了中文的 tag, 訂閱的 feed 會無法刪除 tag, 而且左邊的 tag 列表裡的中文 tag 展開以後, 換頁不會記住已經展開的狀態. Feed 的 title 如果是中文的話, 也顯示不出來. 除此之外, 其他對於中文的內容都沒有問題.</li><li>一些使用介面上還不夠好, 為 feeds 加減 tag(s) 只能在 Manage feeds 的網頁中做, 無法在閱覽的時候做, 不太方便.</li><li>速度有點慢. 這點牽涉到 Ajax 技術上的問題, 是後面的主要討論內容.</li></ol></p>]]>
      <![CDATA[<p>我使用這類 web-based 的 RSS reader 最大的考量有三點, 第一是功能性, 第二是使用介面, 第三是反應速度. 這三點沒有一定的優先順序, 有時候可能得彼此 tradeoff. Bloglines 功能上可滿足我, 但速度略慢, <a href="http://blog.yuan.cc/ck/archives/001181.html">偶爾會有水電工跑出來維修</a>. Rojo 看來在功能上更勝一籌, 我很喜歡可以 tag feeds 跟 articles 的功能. 但是速度還是有點慢. </p>

<p>我先前很快的就說 Rojo 使用了 Ajax 的技術, 現在看來是有些疑問的. 依照 Ajax 一詞最早的出處 "<a href="http://www.adaptivepath.com/publications/essays/archives/000385.php">Ajax: A New Approach to Web Applications</a>" 所定義:</p>

<blockquote>Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:

<p>    * standards-based presentation using XHTML and CSS;<br />
    * dynamic display and interaction using the Document Object Model;<br />
    * data interchange and manipulation using XML and XSLT;<br />
    * asynchronous data retrieval using XMLHttpRequest;<br />
    * and JavaScript binding everything together.</blockquote></p>

<p>首先在 Ajax 的定義上便有爭議 (如果 Ajax 可以有定義的話), 這篇 "<a href="http://www.quirksmode.org/blog/archives/2005/03/ajax_promise_or.html">Ajax, promise or hype?</a>" 便質疑這部分. 是否 Ajax 一定要使用 XML 或 XMLHttpRequest, 甚至 XSLT? 而我認為最關鍵之處在於是否具備了 Asynchronous Data Retrieval 的特性.</p>

<p>影響 Web Application 速度最劇的, 不僅在於伺服器是否有足夠的資料處理能力, 層層的資料傳遞堆疊恐怕是更大的殺手. Asynchronous Data Retrieval 可以讓 DHTML 與使用者互動時動態載入資料, 再產生出想要呈現的 HTML 外觀介面. 但是如果用了不好的 Asynchronous Data Retrieval 方法, 恐怕在反應速度上要大打折扣. </p>

<p>Rojo 使用的其實是一個名為 Remote Scripting 的技術, 這項技術最早在 "<a href="http://developer.apple.com/internet/webcontent/iframe.html">Remote Scripting with IFRAME</a>" 中被提出. 這種方法會在網頁中放一個隱藏的 iframe, 然後利用這個 iframe 去擷取遠端的資料. 可以這樣做的原因是因為在同一個 document 之下的 frame, 都可以用 DOM/Javascript 來彼此控制存取, 因此透過一個 iframe 便可用來當作與遠端資料交換的 channel, 而不需要轉換 www 頁面. (轉換一個 www 頁面其實是非常慢的, 因為除了要 web server 重新產生新的 HTML 之外, 瀏覽器還得 render 並造出整個 Dom Tree.)</p>

<p>來瞧瞧 Rojo 中的 Javascript 片段中的 Remote object:</p>

<blockquote>

<p>Remote.setup()<br />
Remote.exec()<br />
Remote.execRequest()<br />
Remote.iFrameOnLoad()<br />
Remote.getIFrameContents()<br />
Remote.changeIFrameLocation()<br />
Remote.callback()<br />
Remote.iFrame<br />
Remote.requests<br />
Remote.waitingForResponse<br />
Remote.callbackArguments<br />
</blockquote></p>

<p>用 iframe 這種方法似乎不是很理想, 在速度上還是太慢. 因為一個 frame 之內仍然包含一個 document object, 在這個 document 之下還有 Head, Body 等 object, 最後要從 Body object 來取回其 innerHTML 內所含的資料. 而利用 frame 送出一個 HTTP request 給遠端的伺服器, 對規劃不佳的 web server 而言, 仍可能透過一般的 HTTP server side engine 來產生回應. 這類只需 Data Retrival 的 Web Service, 大多是資料庫查詢就可得到的結果, 大可不必透過一般的 Web Server, 直接使用 XML Server 等 lightweight HTTP server 即可. </p>

<p>最後 Rojo 究竟算不算 Ajax 的應用? 如果依照嚴格的 Ajax 定義, 那應該不算. 如果是以 Asynchronous Data Retrieval 的精神來論, 可能只能說符合這種設計精神; 但在速度效能的表現上, 沒有充分的發揮 Ajax 能達到的快感. :)</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/08/hacking_rojo_ro.html</feedburner:origLink></entry>
  <entry>
    <title>Rojo</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/5X4Vl5dyFNE/rojo.html" />
    <modified>2005-12-25T04:59:41Z</modified>
    <issued>2005-08-15T02:27:50+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1242</id>
    <created>2005-08-14T18:27:50Z</created>
    <summary type="text/plain">從我的 log 裡發現有人用這個 Rojo 訂閱我的格格部落, 好奇之下去試用了一下, 覺得還挺好用的. 大致上就是另一個 web-based 的 RSS reader, 用起來跟 Bloglines 有點像, 雖然功能稍少了一點, 不過太多無關功能我也用不到....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>IT</category>
            <category>RSS</category>
            <category>Rojo</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>從我的 log 裡發現有人用這個 <a href="http://www.rojo.com/">Rojo</a> 訂閱我的格格部落, 好奇之下去試用了一下, 覺得還挺好用的. 大致上就是另一個 web-based 的 RSS reader, 用起來跟 <a href="http://www.bloglines.com/">Bloglines</a> 有點像, 雖然功能稍少了一點, 不過太多無關功能我也用不到. </p>]]>
      <![CDATA[<p>在瀏覽與 Feeds 管理上, Rojo 用了不少<a href="http://blog.yuan.cc/ck/archives/001009.html">Ajax</a> 技術, 因此在速度上的感受還不錯. Rojo 可以對每一篇 Blog 文章加 tag, 是不錯的功能; 然後可以依照自己的 tag 找自己看過的文章, 或是去找別人加了 tag 的文章, 無論對搜尋自己想保留的文章, 或是找其他人也用同樣 tag 的相關文章都很方便. 還可以為每篇文章加上 comments 跟 flag, comments 不用多解釋了, flag 則有點像是 <a href="https://mail.google.com/">GMail</a> 裡的 Starred, 一個特別的標記類似 favorites 的用途. 另一個不錯的功能是 related links, 可以知道誰的文章有 link 到我的文章, 跟 <a href="http://www.bloglines.com/">Bloglines</a> 的 references 功能一樣, 但是找到的 links 似乎比 <a href="http://www.bloglines.com/">Bloglines</a> 還多些.</p>

<p>我試著將我在 <a href="http://www.bloglines.com/">Bloglines</a> 的 feeds 匯出成 OPML, 再匯入到 Rojo 去, 我訂閱的 feeds 就全部轉過去了, 一切都很順利; 而且匯入到 Rojo 後, 還會依照 Bloglines 自動設好相同的 feeds 分類. 是很好的 <a href="http://www.bloglines.com/">Bloglines</a> 替代品, 再也不用擔心 <a href="http://blog.yuan.cc/ck/archives/001158.html">feeds 不見的事件</a>重演了.</p>

<p>看來一切都很不錯, 試用一陣子看看再決定要不要轉台. :)</p>

<p>Rojo 的網址是 <a href="http://www.rojo.com/">http://www.rojo.com/</a></p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/08/rojo.html</feedburner:origLink></entry>
  <entry>
    <title>Flickr Comments in your blog</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/g07miSMfVWo/flickr_comments.html" />
    <modified>2006-07-07T04:39:35Z</modified>
    <issued>2005-08-09T01:01:52+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1229</id>
    <created>2005-08-08T17:01:52Z</created>
    <summary type="text/plain"> 我改良了之前寫的 Toggle Recent Comments in Flickr Photostream, 這次可以把在 Flickr 的 comments 放進 Blog 中. 擁有 Blog 的人很多也喜歡 Flickr, 因為存放空間是無限大而且免費, 而 Flickr 也鼓勵使用者可以在自己網站連結他們的照片. 其實 Flickr 本身就是一個龐大的社群, Blog 自己則是一個小的社群, 這兩群使用者有時候是重疊, 有時則不盡然. 很多人都在自己的 Blog 放上了 Flickr badge, 透過這個 script, 可以在 Blog 裡嵌進一個...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Blog</category>
            <category>Flickr</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<a href="http://www.flickr.com/photos/ckyuan/32402960/"><img src="http://photos23.flickr.com/32402960_3f8bd94852_m.jpg" width="92" height="240" alt="Flickr Comments Box for Blog" align="left" style="margin:10px;" /></a>

<p>
我改良了之前寫的 <a href="http://blog.yuan.cc/ck/archives/001057.html">Toggle Recent Comments in Flickr Photostream</a>, 這次可以把在 <a href="http://www.flickr.com/">Flickr</a> 的 comments 放進 Blog 中. </p>

<p>擁有 Blog 的人很多也喜歡 Flickr, 因為存放空間是無限大而且免費, 而 <a href="http://www.flickr.com/">Flickr</a> 也鼓勵使用者可以在自己網站連結他們的照片. 其實 <a href="http://www.flickr.com/">Flickr</a> 本身就是一個龐大的社群, Blog 自己則是一個小的社群, 這兩群使用者有時候是重疊, 有時則不盡然. 很多人都在自己的 Blog 放上了 <a href="http://www.flickr.com/badge_new.gne">Flickr badge</a>, 透過這個 script, 可以在 Blog 裡嵌進一個 Flickr Comments Box, 可以讓讀者看到格主在 <a href="http://www.flickr.com/">Flickr</a> 上的相片留言. </p>

<p>安裝與使用法則類似 <a href="http://www.flickr.com/badge_new.gne">Flickr Badges</a>, 還可以自己調整 CSS 來搭配 Blog 的外觀.</p>
<br clear=all>

【更新】修改了一下程式, comments 的載入改成 on-demand, 感覺比較 "像" Ajax 模式在背景作業, 並且增加一個 flickr_entries 的參數, 來決定載入的 comments 數量; 載入時還會顯示 'Loading...' 的字樣.]]>
      <![CDATA[<style>
#flickr_comments {
        width: 200px;
        padding:5px;
        border:1px;
        background-color:#eeeeee;
}
#flickr_comments span {
        font-size: 13px;
        font-family: Verdana, Arial, sans-serif;
        text-transform: uppercase;
}
#commentList {
        margin:0px;padding:0;
}
#commentList ul {
        margin:3px;
        padding:0;
        min-height:72px;
}
#commentList ul img {
        float:right;
        width:70px;
        border:0px;
        border-color: #ffffff;
        margin:5px;
}
#commentList ul p {
        padding-top:2px;
        padding-left:2px;
        padding-right:20px;
        padding-bottom:0px;
        color: #666666;
        font-family: Verdana, Arial, sans-serif;
        font-size: 11px;
}
#commentList ul a {
        color: #666666;
        font-family: Verdana, Arial, sans-serif;
        font-size: 11px;
}
</style>

<blockquote><p>I create a new script that can load your recent flickr comments and embed into your blog or web site.</p>

<p>Bloggers love flickr so much because of the free and unlimited space. The community of flickr usually overlaps the readers of our blogs. We already have the flickr badges to show our photos. Now we can put a flickr comments box in the blogs. </p>

<p>This script, a variation of '<a href="http://www.flickr.com/groups/topic/45151/">Recent comments in photostream</a>', can embed flickr comments in your blog.</p></blockquote>

<p><strong>Live demo</strong>: </p>
<script type="text/javascript">
flickr_nsid = '62869273@N00';
flickr_comments = 'click to see comments';
flickr_open = false;
flickr_entries = 10;
</script>
<script type="text/javascript" src="http://webdev.yuan.cc/flickr/flickr.comments.js"></script>

<p><strong>Usage</strong>:</p>

Include the following script in your HTML.

<p><strong>Control Parameters:</strong></p>

<blockquote><pre style="font-family: Courier,monospace;font-size: small;	line-height: 110%;background-color: #eee; color: #444;">
....... HTML head .......
&#60;script&#62;
// your flickr userid (nsid)
flickr_nsid = '62869273@N00';	
// the title
flickr_comments = 'My Flickr Comments';	
// the number of entries to show, max is 10
flickr_entries = 10;
// open comments box by default
flickr_open = false;
&#60;/script&#62;
....... HTML head .......

....... HTML body .......
&#60;script src=&quot;http://webdev.yuan.cc/flickr/flickr.comments.js&quot;&#62;&#60;/script&#62;
....... HTML body .......
</small></pre></blockquote>

Following is the sample CSS style. It can let you control the looking appearance to fit your blog.

<blockquote><pre style="font-family: Courier,monospace;font-size: small;	line-height: 110%;background-color: #eee; color: #444;">
&#60;style&#62;
#flickr_comments {
        width: 200px;
	padding:5px;
	border:1px;
	background-color:#eeeeee;
}
#flickr_comments span {
	font-size: 13px;
	font-family: Verdana, Arial, sans-serif;
	text-transform: uppercase;
}
#commentList { 
	margin:0px;padding:0;
}
#commentList ul {
	margin:3px;
	padding:0;
	min-height:72px;
}
#commentList ul img { 
	float:right;
	width:70px;
	border:0px;
	border-color: #ffffff;
	margin:5px;
}
#commentList ul p {
	padding-top:2px;
	padding-left:2px;
	padding-right:20px;
	padding-bottom:0px;
	color: #666666;
	font-family: Verdana, Arial, sans-serif;
	font-size: 11px;
}
#commentList ul a {
	color: #666666;
	font-family: Verdana, Arial, sans-serif;
	font-size: 11px;
}
&#60;/style&#62;
</small></pre></blockquote>

<script>document.location='http://flickr.tw/2005/08/flickr_comments_in_your_blog.html';</script>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/08/flickr_comments.html</feedburner:origLink></entry>
  <entry>
    <title>DEL.ICIO.US DIREC.TOR 的 Ajax 作法</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/jln3zIXNtWY/delicious_direc.html" />
    <modified>2005-09-12T23:55:56Z</modified>
    <issued>2005-06-27T15:40:14+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1089</id>
    <created>2005-06-27T07:40:14Z</created>
    <summary type="text/plain">看到 好 多 人 介紹 DEL.ICIO.US DIREC.TOR 了, 但直到看了嘟嘟老窝的這篇「极力推荐一个del.icio.us书签浏览小工具」中的原理說明, 才頓悟我之前寫 AJAX 遇到的 XMLHttpRequest 安全性問題有簡單的解法 - 用 bookmarklet 來達成. 如此一來, 似乎可以改寫 Lightweight flickr Viewer 成 bookmarklet 的版本來避免此問題, 而且在切換 flcikr &amp; LfVr 時, 連 IE 也可以使用, 不需要再透過 Greasemonkey 了....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Firefox</category>
            <category>Flickr</category>
            <category>IT</category>
            <category>LfVr</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>看到 <a href="http://goston.blogspot.com/2005/06/delicious-director.html">好</a> <a href="http://www.duduwolf.com/post/176.asp">多</a> <a href="http://www.azuremedia.net/tech/history/content_management/001161.html">人</a> 介紹 <a href="http://johnvey.com/features/deliciousdirector/">DEL.ICIO.US DIREC.TOR</a> 了, 但直到看了<a href="http://www.duduwolf.com/">嘟嘟老窝</a>的這篇「<a href="http://www.duduwolf.com/post/176.asp">极力推荐一个del.icio.us书签浏览小工具</a>」中的原理說明, 才頓悟我之前寫 <a href="http://www.adaptivepath.com/publications/essays/archives/000385.php">AJAX</a> 遇到的 XMLHttpRequest 安全性問題有簡單的解法 - 用 bookmarklet 來達成.</p>

<p>如此一來, 似乎可以改寫 <a href="http://flickr.yuan.cc/lfvr/">Lightweight flickr Viewer</a> 成 bookmarklet 的版本來避免此問題, 而且在切換 flcikr & LfVr 時, 連 IE 也可以使用, 不需要再透過 Greasemonkey 了.</p>]]>
      <![CDATA[<p><a href="http://www.duduwolf.com/">嘟嘟老窝</a>說道:</p>

<blockquote>技术:<br />
1. 客户端AJAX，或站内AJAX：略.<br />
2. 服务器端代理AJAX：略.<br />
3. 客户端代理AJAX：这个想法真的很棒，太有创意了。本篇介绍的这个工具就是利用了这一条。我在安装那段第二条中写道：打开del.icio.us随便进入一个页面，为什么要必须打开一个del.icio.us的页面呢？因为只有打开这个页面你的浏览器当前域就属于del.icio.us了，这时候点击快捷栏上的书签时调用AJAX其实就赋予了代码的del.icio.us域的权利，所以才能实现从web1取代码后和web2进行通讯(以往这就属于跨域了)，关键就是先要打开一个del.icio.us的页面</blockquote>

<p>重點就在於 <u>3. 客戶端代理 AJAX</u> 了. 原先 LfVr 算是使用了 <a href="http://clippoapesta.com/flickrapi/">FlickrJS</a> 的服務器端代理 AJAX 的技術, 透過 proxy.flickr 來轉介 XML request.</p>

<p>相關網站:</p>

<p><a href="http://flickr.yuan.cc/">Yuan.CC Web Experiments</a><br />
<a href="http://flickr.yuan.cc/lfvr/">LfVr</a><br />
<a href="http://del.icio.us/">del.icio.us</a><br />
<a href="http://johnvey.com/features/deliciousdirector/">del.icio.us direc.tor</a></p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/06/delicious_direc.html</feedburner:origLink></entry>
  <entry>
    <title>關於 LfVr - a Lightweight flickr Viewer</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/NX9Clk1W3Ww/e_lfvr.html" />
    <modified>2005-09-12T23:59:06Z</modified>
    <issued>2005-06-20T02:33:53+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1068</id>
    <created>2005-06-19T18:33:53Z</created>
    <summary type="text/plain">LfVr 就是 Lightweight flickr Viewer. 這個前一陣子寫好的程式, 擱了好久都沒介紹. 原因是應該要好好談談, 但是一直沒時間, 因為內部牽涉的技術跟痛苦經驗頗多的, 想紀錄的東西一多就懶得下筆了. 先來個摘要吧, This is a pure Javascript Flickr viewer called "LfVr". The viewer is based on FlickrJS made by Gustavo Marin. This viewer is designed by ajax approach and runs...</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Flickr</category>
            <category>Greasemonkey</category>
            <category>IT</category>
            <category>LfVr</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>LfVr 就是 <a href="http://flickr.yuan.cc/lfvr/">Lightweight flickr Viewer</a>. </p>

<p>這個前一陣子寫好的程式, 擱了好久都沒介紹. 原因是應該要好好談談, 但是一直沒時間, 因為內部牽涉的技術跟痛苦經驗頗多的, 想紀錄的東西一多就懶得下筆了.</p>

<p>先來個摘要吧,</p>

<blockquote>This is a pure Javascript Flickr viewer called "LfVr". The viewer is based on FlickrJS made by Gustavo Marin.

<p>This viewer is designed by ajax approach and runs fast. I exploited most Flickr APIs to build the viewer with most frequent used funtionalities. You can search and browse photos by users, contacts, photosets, tags, or groups.</blockquote></p>]]>
      <![CDATA[<p>不過我是個連 documentation 都懶得寫的差勁 programmer, 怎麼有力氣談什麼設計過程. 甚至連個簡單的介紹與使用說明都還沒寫. 不過還好我發現好心的 <a href="http://goston.blogspot.com/">Goston</a> 已經幫我寫了<a href="http://goston.blogspot.com/2005/06/flickr-flickr-lfvr.html">一篇很棒的圖文並茂的介紹</a>, 我可以省點力氣了. :p</p>

<p>其實動機就是想快速瀏覽相片, 我又對新鮮技術有點好奇, 再加上 <a href="http://www.flickr.com/">Flickr</a> 開放 API, 我很早就想試試 Ajax 的 Web App 的寫法了, 於是就來試試看. </p>

<p>LfVr 是個怪字, 反正也是學一下 <a href="http://www.flickr.com/">Flickr</a> 的怪怪, 他偏偏要在字尾加個 r 耍酷, 讓人念不太出來, 常錯讀成 k-er 的音. 而 LfVr 沒有母音, 更怪吧, 反正我耍無聊也不是一兩天的事了. 有趣的是, 我去 <a href="http://www.google.com/">Google</a> 跟 <a href="http://www.yahoo.com/">Yahoo</a> 搜尋 LfVr 的時候, Google 把我在 <a href="http://www.flickr.com/">Flickr</a> 的 <a href="http://www.flickr.com/groups/api/">Flickr API</a> 上發佈的 LfVr 列為第一, <a href="http://flickr.yuan.cc/lfvr/">LfVr</a> 網站則是第二, 喂喂喂, 我可是官方網站耶!! 不要給我留言談 <a href="https://www.google.com/webmasters/sitemaps/stats?hl=en">Google Sitemaps</a>, 我已經知道了, 但是懶得安裝. 倒是 <a href="http://www.yahoo.com/">Yahoo</a> 精準的把我的網站排在第一, <a href="http://goston.blogspot.com/">Goston's Blog</a> 的文章排第二, 再來是 Furl, 至於 <a href="http://www.flickr.com/groups/api/">Flickr API</a> 的討論, 被遠遠拋到第二頁去了. 怪了, Flcikr 不是被 Yahoo 買了嗎? 搜尋引擎沒有給 Flickr 多一點分數嗎?</p>

<p>回到正經的話題, 對於現在開放 API 的一些網路服務, 其實是很有趣與值得觀察的現象. 對一個已經很成功的服務來說, 這種模式有效的吸引了很多開發者參與, 也做出了很多有趣有用的東西. 只是當開放的 API 非常豐富的時候, 是否會影響自己的利基? 當 Third Party 做的功能超越原始站時, 原始服務的優勢又在那裡? 另一個有趣的應用則是 <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a>, 當使用者端可以自行修改變更主站的型態, 影響會有多大? 影響會大到原始網站開始反彈嗎? 這一篇 <a href="http://www.oui-blog.com/archives/2005/06/gmailgreasemonk.php">Gmail正式向 Greasemonkey 宣戰</a>點出了這個話題. 將來的網路服務會是什麼型態? 跟使用者又如何互動? 使用者究竟有沒有完全的自主權? Let's wait and see.</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/06/e_lfvr.html</feedburner:origLink></entry>
  <entry>
    <title>GM Script: Toggle Recent Comments in Flickr Photostream</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/uWmWkNvu94o/toggle_recent_c.html" />
    <modified>2005-09-13T00:18:29Z</modified>
    <issued>2005-06-18T03:11:52+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1057</id>
    <created>2005-06-17T19:11:52Z</created>
    <summary type="text/plain">我新改寫的 Greasemonkey user script - Toggle Recent Comments in Flickr Photostream. 在 Flickr 中要看誰有對自己的照片 comments 的方法, 除了一張張照片進去看之外, 比較方便的就是從這裡去看: http://www.flickr.com/recent_comments.gne ; 在這個畫面之下則有 RSS/Atom feeds 可以訂閱. 如果不訂閱 RSS, 要特定跑來這個網址有時還挺麻煩的, 因為他只在 Flickr 的首頁有放連結, 而不是在每個畫面都有....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Code</category>
            <category>Flickr</category>
            <category>Greasemonkey</category>
            <category>RSS</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>我新改寫的 Greasemonkey user script - Toggle Recent Comments in Flickr Photostream.</p>

<p>在 Flickr 中要看誰有對自己的照片 comments 的方法, 除了一張張照片進去看之外, 比較方便的就是從這裡去看: <a href="http://www.flickr.com/recent_comments.gne">http://www.flickr.com/recent_comments.gne</a> ; 在這個畫面之下則有 RSS/Atom feeds 可以訂閱. 如果不訂閱 RSS, 要特定跑來這個網址有時還挺麻煩的, 因為他只在 Flickr 的首頁有放連結, 而不是在每個畫面都有. </p>]]>
      <![CDATA[<p>setre (<a href="http://flickr.com/photos/setre/">http://flickr.com/photos/setre/</a>) 在 Flickr Hacks 公布了一個 Greasemonkey 的 script, 可以在首頁直接顯示最近六則 comments. 他的原理就是在網頁中直接用 Javascript 的 xmlhttpRequest 直接抓 RSS feed (因為此功能 Flickr API 沒有提供), 非常聰明.</p>

<p>但是這個顯示 comments 的畫面太長了, 不是很美觀. 於是我就改寫了一下, 要看 comments 時, 要按一下 "Recent Comments" 才會顯示出來, 再按一次就會關閉.</p>

<p>下載: <a href="http://flickr.yuan.cc/greasemonkey/flickr.comments.toggle.user.js">flickr.comments.toggle.user.js</a></p>

<p>更新: 上面那個 GM user script 是更新版, 先前的有 bug, 跳到第二頁以後 Recent Comments 的 Link 出不來; 之前有安裝的朋友請重新安裝.</p>

<p><a href="http://www.flickr.com/photos/ckyuan/19962017/" title="Photo Sharing"><img src="http://photos14.flickr.com/19962017_3d972c979e_m.jpg" width="199" height="240" alt="Toggle Recent Comments" /></a></p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/06/toggle_recent_c.html</feedburner:origLink></entry>
  <entry>
    <title>Yet Another Flickr Badges</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/-rwPMYEkW4M/yet_another_fli.html" />
    <modified>2005-08-26T09:46:40Z</modified>
    <issued>2005-05-18T16:16:59+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1010</id>
    <created>2005-05-18T08:16:59Z</created>
    <summary type="text/plain"> 在上一篇提到的 FlickrJS 可以很容易寫出 Ajax 的 Flickr 網頁程式, 於是我牛刀小試寫了兩個自己想要的 Flcirk Badges. 可以直接在網頁上看下一張相片而不需重新 reload 網頁. 速度很快, 非常 light-weight. 程式碼還是放在我的 Yuan.CC Web Experiments 網站中, 有興趣者歡迎去試試....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Flickr</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p><a href="http://www.flickr.com/photos/ckyuan/14089826/" title="Photo Sharing"><img src="http://photos13.flickr.com/14089826_3e3283d7da.jpg" width="400" height="275" alt="Yet Another Flickr Badge" /></a></p>

<p>在<a href="http://blog.yuan.cc/ck/archives/001009.html">上一篇</a>提到的 <a href="http://clippoapesta.com/flickrapi/">FlickrJS</a> 可以很容易寫出 Ajax 的 Flickr 網頁程式, 於是我牛刀小試寫了兩個自己想要的 Flcirk Badges.  可以直接在網頁上看下一張相片而不需重新 reload 網頁. 速度很快, 非常 light-weight. 程式碼還是放在我的 <a href="http://flickr.yuan.cc/">Yuan.CC Web Experiments</a> 網站中, 有興趣者歡迎去試試.</p>]]>
      <![CDATA[<p>在我寫這兩個 Flickr badges 的時候, 發現 FlickrJS 有幾個 bug, 我就寫信給原作者回報, 並傳給他我 patch 過的程式. 他回信說他更正了錯誤, 並<a href="http://clippoapesta.com/archivos/2005/05/16/mejoras-al-flickrjs.html">寫了一篇 blog 介紹我的 badges</a>. 可是, 他是用西班牙文寫的, 我看不懂啊....</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/05/yet_another_fli.html</feedburner:origLink></entry>
  <entry>
    <title>Ajax and FlickrJS</title>
    <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Ajax/~3/FLQOI3qFBuI/ajax_and_flickr.html" />
    <modified>2005-09-17T08:12:11Z</modified>
    <issued>2005-05-18T13:14:09+08:00</issued>
    <id>tag:blog.yuan.cc,2005:/ck/4.1009</id>
    <created>2005-05-18T05:14:09Z</created>
    <summary type="text/plain">自從 Ajax 這個字從這篇文章 Ajax: A New Approach to Web Applications 提出後, Ajax 成為非常熱門且普遍的新技術名詞, 很快的 Wikipedia 也收錄進來了. 而我從 Flickr API 的 group 看到了 FlickrJS 這個 Flickr API 開發工具, 算是符合 Ajax 的設計理念....</summary>
    <author>
      <name>yuan</name>
      
      <email>ck@yuan.cc</email>
    </author>
            <category>Ajax</category>
            <category>Flickr</category>
            <category>IT</category>
            <category>Web</category>
    
    <content type="text/html" mode="escaped" xml:lang="zh-tw" xml:base="http://blog.yuan.cc/ck/">
      <![CDATA[<p>自從 Ajax 這個字從這篇文章 <a href="http://www.adaptivepath.com/publications/essays/archives/000385.php">Ajax: A New Approach to Web Applications</a> 提出後, Ajax 成為非常熱門且普遍的新技術名詞, 很快的 <a href="http://en.wikipedia.org/wiki/AJAX">Wikipedia 也收錄進來了</a>. 而我從 <a href="http://www.flickr.com/groups/api/">Flickr API</a> 的 group 看到了 <a href="http://clippoapesta.com/flickrapi/">FlickrJS</a> 這個 Flickr API 開發工具, 算是符合 Ajax 的設計理念.</p>]]>
      <![CDATA[<p>Ajax 並不是新技術, 他的定義如下:</p>

<blockquote>Defining Ajax

<p>Ajax isn't a technology. It's really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:</p>

<ul><li>standards-based presentation using XHTML and CSS;</li>
<li>dynamic display and interaction using the Document Object Model;</li>
<li>data interchange and manipulation using XML and XSLT;</li>
<li>asynchronous data retrieval using XMLHttpRequest;</li>
<li>and JavaScript binding everything together.</li></ul></blockquote>

<p>Ajax 的全名是 Asynchronous JavaScript + XML, 它稱不上是新技術, 只是一種新的 Web Application 設計方式, 整合了過去數種早已存在的技術. 但是這樣的 Web 應用程式卻很 lightwiehgt, 因為許多的動作不需連回原來的 web server 產生新網頁, 而只需 XMLHttpRequest 取回 XML data, 便可以利用 Javascript 重新安排網頁元素, 呈現出 Desktop Application 般的互動效果. 在市場上, 這種設計技術由 <a href="http://www.google.com">Google</a> 開始大量產品化, 像是 <a href="http://www.gmail.com/">Gmail</a>, <a href="http://groups-beta.google.com/">Google Groups</a>, <a href="http://www.google.com/webhp?complete=1&hl=en">Google Suggest</a>, and <a href="http://maps.google.com/">Google Maps</a> 都是採用此種方式設計出來的. 不過要澄清的是, 嚴格的說, 不能說是 Google 採用了 Ajax 的技術, 因為是 Google 先以這種 approach 設計產品, 而後才有 Ajax 這個名詞被定義出來. Cradit 還是要分清楚的. 當然, Google 是否是第一個採用這個 approach 我也不知道, 但至少是 Google 帶動的流行.</p>

<p>上星期在閒逛 <a href="http://www.flickr.com/groups/api/">Flickr API 的討論區</a>時, 看到了 <a href="http://www.flickr.com/groups/topic/29051/">FlickrJS 這樣的作法</a>. 它是一個 wrapper, 把呼叫 flickr.photps.xxx 之類的 Flickr API 給替換掉, 這個 wrapper 會將呼叫 flickr api 的動作回傳給 proxy server, 再把由 proxy server 取回的 XML data 交回 caller. 為什麼要這樣做? 為何不直接用 Javascript call flickr api service? 因為瀏覽器的安全性設計, 是不允許 Javascript 執行 out of site 的 http request, 於是 Javascript 英雄無用武之地, 無法得到使用 flickr api 的好處. </p>

<p>在 <a href="http://www.flickr.com/services/api/">Flickr API 的文件</a>中, 列了許多連結 flickr 的開發工具, 不過幾乎都是 server side 的程式庫. 而 FlickrJS 卻是 client side 的 Javascript library. 使用了 FlickrJS 之後, 就可以輕鬆的用 Javascript 寫出一個 Ajax design approach 的 Flickr 網頁應用程式.</p>]]>
    </content>
  <feedburner:origLink>http://blog.yuan.cc/ck/archives/2005/05/ajax_and_flickr.html</feedburner:origLink></entry>

</feed>

