Thursday, March 30, 2006

(XBMC) 中文RSS顯示

二○○五年七月二十五日的更新,有以下一段:
- 25-07-2005 fixed: SF bug [ 1065692 ] RSS does not work for non-Latin character. You can now view any language in the RSS, as long as you use TTF. Hebrew/arabic RSS is flipped.

XBMC正式支援中文RSS。但初期的版本很容易當機,於是在七月二十七日的修正中,有:
- 26-07-2005 fixed: RSS crash due to code rearrangement.

經過測試成功後,RSS繁體中文的支援算是完成了。


單一列RSS可跑多重來源,即使中英混雜(奇摩即時新聞+CNN Top Story),也沒有問題!以下是目前我找到的有即時新聞的中文RSS網址:

中時:
焦點新聞:http://rss.chinatimes.com/rss/focus.rss
政治新聞:http://rss.chinatimes.com/rss/Politic.rss
財經產業:http://rss.chinatimes.com/rss/finance.rss
股市新聞:http://rss.chinatimes.com/rss/stock.rss
社會綜合:http://rss.chinatimes.com/rss/social.rss
國際新聞:http://rss.chinatimes.com/rss/international.rss
大陸新聞:http://rss.chinatimes.com/rss/mainland.rss
地方新聞:http://rss.chinatimes.com/rss/local.rss
社評論壇:http://rss.chinatimes.com/rss/comment.rss
科技新聞:http://rss.chinatimes.com/rss/technology.rss
校園新聞:http://rss.chinatimes.com/rss/education.rss
醫療保健:http://rss.chinatimes.com/rss/health.rss
生活新聞:http://rss.chinatimes.com/rss/life.rss
影視娛樂:http://rss.chinatimes.com/rss/showbiz.rss
運動天地:http://rss.chinatimes.com/rss/sport.rss
旅遊新聞:http://rss.chinatimes.com/rss/travel.rss
藝文新聞:http://rss.chinatimes.com/rss/philology.rss

奇摩:
即時新聞:http://tw.news.yahoo.com/rss/realtime
政治:http://tw.news.yahoo.com/rss/politics
社會:http://tw.news.yahoo.com/rss/society
國際:http://tw.news.yahoo.com/rss/international
兩岸:http://tw.news.yahoo.com/rss/twoshore
財經:http://tw.news.yahoo.com/rss/finance
影視:http://tw.news.yahoo.com/rss/entertainment
體育:http://tw.news.yahoo.com/rss/sports
生活:http://tw.news.yahoo.com/rss/leisure
休閒:http://tw.news.yahoo.com/rss/relaxation
科技:http://tw.news.yahoo.com/rss/technology
健康:http://tw.news.yahoo.com/rss/health
新奇:http://tw.news.yahoo.com/rss/oddlyenough

蕃薯藤:
即時:http://news.yam.com/RSS/Rss_all.xml
財經:http://news.yam.com/RSS/Rss_fn.xml
娛樂:http://news.yam.com/RSS/Rss_entertain.xml
運動:http://news.yam.com/RSS/Rss_sports.xml
生活:http://news.yam.com/RSS/Rss_life.xml
科技:http://news.yam.com/RSS/Rss_computer.xml
健康:http://news.yam.com/RSS/Rss_healthy.xml
文教:http://news.yam.com/RSS/Rss_garden.xml
政治:http://news.yam.com/RSS/Rss_politics.xml
社會:http://news.yam.com/RSS/Rss_society.xml
國際:http://news.yam.com/RSS/Rss_international.xml
兩岸:http://news.yam.com/RSS/Rss_china.xml

PS.中時和奇摩測試OK
蕃薯藤的在XBMC上似乎不能顯示,僅供參考(或許只是我的設定有問題)

一次設定兩列來源,經測試也是可行的:



在XboxMediaCenter.xml裡,設定的範例如下:


<rss>
<set id="1">
<feed updateinterval="30">http://tw.news.yahoo.com/rss/realtime</feed>
<feed updateinterval="30">http://rss.cnn.com/rss/cnn_topstories.rss</feed>
</set>
<set id="2">
<feed updateinterval="30">http://rss.news.yahoo.com/rss/sports</feed>
</set>
</rss>


在要顯示兩列的xml檔裡(如home.xml),其設定如下:

<control>
<description>rss feed</description>
<type>rss</type>
<id>0</id>
<posx>0</posx>
<posy>475</posy>
<width>720</width>
<font>font13</font>
<urlset>1</urlset>
<titlecolor>ffD2FF00</titlecolor>
<headlinecolor>DDced8da</headlinecolor>
<textcolor>ffD2FF00</textcolor>
<visible>!Player.HasVideo</visible>
<include>homemisc</include>
</control>

<control>
<description>rss feed</description>
<type>rss</type>
<id>1</id>
<posx>0</posx>
<posy>508</posy>
<width>720</width>
<font>font13</font>
<urlset>2</urlset>
<titlecolor>ffD2FF00</titlecolor>
<headlinecolor>DDced8da</headlinecolor>
<textcolor>ffD2FF00</textcolor>
<visible>!Player.HasVideo</visible>
<include>homemisc</include>
</control>


另外,XBMC的RSS編碼是獨立的,並不受到桌面編碼的限制,所以有了兩列RSS之後,下一步就是測試多語並存的可行性,上圖是中英並存,這沒什麼了不起,像下面是繁簡中文並列:


改用標楷體字型顯示:


再試試中日文並列:


標楷體也可以看日文喲!


呃…換中韓並列…應該是成功吧?雖然都看不懂…


到了韓文,標楷體就不行了,這時就顯示出arialuni的過人之處。
再找一個比較冷門點的…俄文!:


還是有看沒有懂:( 總之RSS支援多語言之後,配合著arialuni字型,大概全世界的多數語言都搞的定了。

註:
一、修改範例一直貼不上來(裡面含有一些html的tag,因為發生錯亂…),只好作罷。
二、兩列RSS的修改範例已於2006-0508補上。

0 comments: