將圖書館書目資料轉換成引用書目格式轉貼到 WordPress 的 bookmarklet

這個東西是從前面提到的將全國圖書書目資訊網轉換成論文參考書目格式的書籤小工具繼續發展的,簡單來說,這個工具可以讓你在某個圖書館的書目查詢系統,查到某一筆資料的時候,按一下某個書籤,就可以將這筆書目轉成中文論文的引用書目格式,然後透過 WordPress 原本提供的快速發表 bookmarklet 頁面,將這筆資料貼到 WordPress裡頭。然後,你可以使用 WordPress 所提供的分類功能,整理這些書目。

這個工具目前放在中文 WordPress 專案的下載頁面上,把 bookmarklets.tar.gz 抓下來解開之後,會出現一個 bookmarklets 目錄,然後把這個目錄丟到 /wp-contnets/ 底下即可,自然,您需要先安裝一套 WordPress 。要使用的話,就使用瀏覽器開啟 http://example.com/wp-contnets/bookmarklets/,在這個頁面上,您可以看到一個書籤小程式的鍊結,把這個鍊結加入書籤。

Continue reading →

A prototype of the WordPress Technorati-links plugin

I wrote a WordPress plugin last night. It is now running on my own weblog though it is just a prototype now. The function of this plugin is to retrieve the information about how many links is linked to your weblog and your post entries from Technorati.

I consider that Technorati supports two main on-line services, one is it can sort blog entries from any other weblogs, photos from flickr, links from del.icio.us in the same category or tag, while another is you can find the posts from other sites which is linked to your site. Keith McDuffee is now working on a WordPress plugin called TechnoTag, it can let you add tags to your posts as you like, it is used for the first main service of Techorati.

Then, you can see there are many sites would like to use Techorati to display the comments from other weblogs, for instance, there is a hyper-link called “blog’s comments” in every post of BoingBoing, and you can know about how many links are linked to your WordPress 1.5 blog from the dashboard page in the user interface for the administrators. However, there is still no plugin to let you know how many links are linked to your every single post, and this plugin is required, I think.

You can download the plugin here. Save it as a text file with file extension as “.php” and upload to “wp-content/plugins” directory in the directory that you installed WordPress. Visit the “Pugins” tab and unable it. Then, create a cache path such as “wp-content/technorati”, make it writable, and please edit your plugin file and change the value of $cache_path into your exact path. Then, edit your php files located in your WordPress theme directory, and add <?php techolink(get_permalink(), "", "") ?> into the loop. If there are no links linked to the permanent links of your posts, it displays “n links from n sources” , and it display nothing while there is not any link.

This plugin caches the informations from Technorati, I have not finished the part of deleting the cache files to update the informations while Technorati is updated. You need to delete these files by your self in a period whiling using the current version. I may finish it somehow later, and it is welcomed to continue my work if you are interested.

將全國圖書書目資訊網轉換成論文參考書目格式的書籤小工具

剛剛拼拼湊湊,寫了一個小玩意。如果您有興趣使用的話,請先將這個連結加入到您的書籤(或我的最愛)當中。

簡單說來,這個小工具就是在模仿(或抄襲) CiteULike 這個服務的想法,好聽一點的說法,就是受到了啟發。CiteULike 是設計當作學術用途的 del.icio.us 使用的,讓你可以在透過瀏覽器搜尋圖書館以及期刊資訊網站的時候,以書籤小程式的方式,在網站上存放你所看到的書目,而當你最後要使用這些書目的時候,則可以將網站上的資料轉換成 EndNote 等格式,將書目排個順序,然後匯入到論文的文件檔案當中。我個人是頂需要這樣的功能的,因為整理書目實在是一件麻煩事,每次寫完東西之後,最討厭的就是整理書目了,而想要偷懶,就需要能夠幫忙偷懶的工具。

但是對於中文使用者來說,CiteULike 實在不好用,特別是在台灣念文史哲,總會使用到中文書目,CiteULike雖然支援中文輸入,但是不支援輸出中文論文的書目格式,能夠幫得忙就有限了。所以就先試做了一個工具,可以在從全國圖書書目資訊網查詢到某一本書的時候,按個按鈕,就可以轉換成可以插入到中文論文的書目格式。比方說,這邊是Jedi所寫的《BLOG 架站實務》的書目資料,按一下按鈕轉換,結果就是:傑迪 (Jedi),《BLOG 架站實務 》,臺北市 : 旗標,民92,2003。目前我測試的結果,是Firefox以及Safari瀏覽器可以正常使用,IE還沒有測試。

Continue reading →

WordPress 1.5 在 wp-rss2.php 的 bug

最近時間實在不多,所以說真的,實在很不想花時間處理像這樣的事情。而才剛升級到 WordPress 1.5 ,居然就發現了一個嚴重的缺陷,那就是,如果你在 WordPress 1.5 上套用了英文語系以外的語系檔案(例如中文化),那麼 RSS2 的feed就會爛掉,原因是 WP 1.5 會把 RSS2 當中的日期語法,如月份、星期幾等,也一併換成語系檔案中的字串,而造成各種 RSS 閱讀軟體無法閱讀。

解決的方法是要改一下 wp-rss2.php 這個檔案,找一下第 36 行,把:

<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_the_time('Y-m-d H:i:s')); ?></pubDate>

改成

<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_the_time('Y-m-d H:i:s'), 0); ?></pubDate>

相關討論可以參見:

RSS2 feed does not validate when using translation mo file
wp-rss2.php broken after localization

升級 WordPress 1.5

WordPress 1.5版上週正式釋出,這不算是什麼新聞,包括許多在台灣使用WordPress的使用者都已經升級到了新版本,許多甚至在還沒有釋出前就已經更換成開發當中的版本;所以,這個新版本有什麼新功能也就暫且不提,相信在別的地方應該都提過了。

另外,在1.5版還在開發的過程中,piaip就已經製作、完成了正體中文語系檔案zh_TW.po檔案,因此在1.5版釋出的同時,正體中文版的使用者也便立刻已經有了正體中文版本可以使用(下載),因為這陣子我幾乎都把心思放在別的事情上(例如什麼藏文輸入之類的),正體中文的 WP 1.5 版的相關工作,幾乎都是 piaip 獨立完成的。不過,我剛剛看了一下中文WordPress專案的svn repository裡頭好像缺漏了一些檔案的樣子,似乎是在1.5版釋出的前幾天,官方將一些檔案又拆成了獨立的檔案,而忘記順便 svn add 這些檔案,等下應該再來檢查一下。

Continue reading →