MozTW 討論區

各項 Mozilla 相關軟體與技術討論
現在的時間是 2025-11-05, 13:04

所有顯示的時間為 UTC + 8 小時





發表新文章 回覆主題  [ 1 篇文章 ] 
發表人 內容
文章發表於 : 2011-08-08, 18:37 
離線
[網站管理員]
頭像

註冊時間: 2006-11-22, 16:07
文章: 560
  
 
   即時天氣
 
簡介:
  每隔 60 分鐘,從中央氣象局抓取目前天氣資料顯示於書籤標題。透過這個方式安裝的 XML 檔,只有幾 KB 大小可以用來替代 Forecastfox Weather 之類的天氣套件。
 
預覽圖:
圖檔
 
 
安裝方法:
  1. 安裝即時摘要來源:在網址列輸入
    代碼:
    javascript:(function(){var warning="不好意思呢,你得用支援即時摘要的瀏覽器 (如 Firefox 2.0 以上) 才能安裝這玩意喔!";function addGenerator(url){if(typeof window.sidebar=="object"&&typeof window.sidebar.addMicrosummaryGenerator=="function"){window.sidebar.addMicrosummaryGenerator(url);}else{alert(warning);}}addGenerator("http://shyangs.110mb.com/microsummary/tw-weather-V7.xml");})();
    在跳出的視窗「新增即時摘要來源」按確定。
  2. 到中央氣象局目前天氣PDA網頁選擇一個地區,例如我們選台北,將該網頁加入書籤,並將書籤放到工具列上。
  3. 在上一步驟所加入的書籤上按右鍵,選擇屬性,下拉名稱選單,選取即時標題項目後按確定。
 
 
補充:
  • Firefox 3 以後的版本,對過長的的書籤標題,會刪節省略;可以安裝 Places’ Full Titles 套件來顯示書籤全標題;或者安裝 Stylish,並使用 Show Full Titles on Bookmarks 這樣式。如果你不喜歡安裝套件,請拆開 Places’ Full Titles,複製 placesfulltitles.css 檔案裡的樣式代碼到 userChrome.css
    圖檔
  • 安裝 即時摘要來源 後會在 Profile 裡建立一個名為 microsummary-generators 的子目錄,然後 即時摘要來源的xml檔 會放在裡面。

參考資料

附件: tw-weather-V7.xml 內容
代碼:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2011 Shyangs @ http://shyangs.110mb.com/microsummary/tw-weather-V7.html -->
<generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="TW weather" uri="urn:{b73d2227-3831-4ce4-ab0e-21d044651e48}">
 <pages>
   <include>^http://www\.cwb\.gov\.tw/pda/observe/real/.*\.htm</include>
 </pages>
 <template>
   <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
     <output method="text"/>
         <template match="/">
            <value-of select="normalize-space(string(//div[@id='content']/ul/li[2]/select/option[@selected]))"/>
            <text>(</text>
            <value-of select="normalize-space(string(//div[@id='content']/ul[2]/li/span[2]))"/>
            <text>):</text>
            <value-of select="normalize-space(string(//div[@id='content']/ul[2]/li[2]/span[2]))"/>
            <text>,</text>
            <value-of select="normalize-space(string(//div[@id='content']/ul[2]/li[3]/span[2]))"/>
            <text>℃</text>
         </template>
   </transform>
 </template>
 <update interval="60"/>
</generator>

_________________


回頂端
Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.2.16) Gecko/20110323 Firefox/3.6.16 (tete009 SSE2 PGO)
 個人資料  
引用回覆  
顯示文章 :  排序  
發表新文章 回覆主題  [ 1 篇文章 ] 

所有顯示的時間為 UTC + 8 小時


誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 50 位訪客


不能 在這個版面發表主題
不能 在這個版面回覆主題
不能 在這個版面編輯您的文章
不能 在這個版面刪除您的文章
不能 在這個版面上傳附加檔案

搜尋:
前往 :  
cron
Powered by phpBB® Forum Software © phpBB Group
正體中文語系由 竹貓星球 維護製作
© moztw.org, Mozilla Foundation
MozTW,Mozilla 台灣社群