即時天氣 簡介:
每隔 60 分鐘,從中央氣象局抓取目前天氣資料顯示於書籤標題。透過這個方式安裝的 XML 檔,只有幾 KB 大小可以用來替代
Forecastfox Weather 之類的天氣套件。
預覽圖:
安裝方法:
- 安裝即時摘要來源:在網址列輸入
代碼:
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");})();
在跳出的視窗「新增即時摘要來源」按確定。 - 到中央氣象局目前天氣PDA網頁選擇一個地區,例如我們選台北,將該網頁加入書籤,並將書籤放到工具列上。
- 在上一步驟所加入的書籤上按右鍵,選擇屬性,下拉名稱選單,選取即時標題項目後按確定。
補充:
參考資料
附件: 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>