1. 使用前提是可以上网(自己可以加拨号判断),有curl 和 sed。
2. 默认城市是北京,可以修改第一行链接,具体城市代码到http://www.weather.com.cn/上查
3. 天气部分字体使用的是微软雅黑,没有可以自己自行修改,不过微米黑的°显示不了。
代码: 全选
${execi 600 curl -s --connect-timeout 30 "http://wap.weather.com.cn/data/sk/101010100.html" >/tmp/current }${execi 6000 curl -s --connect-timeout 30 "http://m.weather.com.cn/data/101010100.html" >/tmp/forcast }
${voffset -29}${goto 32}${execi 600 sed 's/^.*"city":"//' /tmp/current | sed 's/",".*$//' }: ${color1}${execi 600 sed 's/^.*"img_title_single":"//' /tmp/forcast | sed 's/",".*$//' } ${execi 600 sed 's/^.*"temp":"//' /tmp/current | sed 's/",".*$//' }°C ${execi 600 sed 's/^.*"WD":"//' /tmp/current | sed 's/",".*$//' }, ${execi 600 sed 's/^.*"time":"//' /tmp/current | sed 's/",".*$//' }${color}
${goto 32}${font Microsoft YaHei:size=9}今日: ${color1}${execi 600 sed 's/^.*"weather1":"//' /tmp/forcast | sed 's/",".*$//' } ${execi 600 sed 's/^.*"temp1":"//' /tmp/forcast | sed 's/",".*$//' }${color}${font}
${goto 32}${font Microsoft YaHei:size=9}明日: ${color1}${execi 600 sed 's/^.*"weather2":"//' /tmp/forcast | sed 's/",".*$//' } ${execi 600 sed 's/^.*"temp2":"//' /tmp/forcast | sed 's/",".*$//' }${color}${font}
${goto 32}${font Microsoft YaHei:size=9}后日: ${color1}${execi 600 sed 's/^.*"weather3":"//' /tmp/forcast | sed 's/",".*$//' } ${execi 600 sed 's/^.*"temp3":"//' /tmp/forcast | sed 's/",".*$//' }${color}${font}
color1 2为自定义颜色,可自行修改
代码: 全选
color1 ffe7ba