Published at: 11:02 pm - Friday February 19 2010
Add this in your conkyrc ${exec curl -s "http://api.hostip.info" | xpath -e "//gml:featureMember/Hostip/gml:name/text()" -q} ${exec curl -s "http://api.hostip.info" | xpath -e "//gml:featureMember/Hostip//gml:coordinates/text()" -q} Hostip is well known as a service provider of the geoclue framework. It translates IP address to geolocation information. The API we use will return a GML document like <?xml version="1.0" encoding="ISO-8859-1" [...]
Published at: 09:02 pm - Thursday February 18 2010
Ubuntu仓库里有个weather-util包,可以用来查看天气信息。weather工具从weather.noaa.gov网站获得天气信息,对美国的城市可以直接用名字查询,其他国家只能使用id查询。id的规则和weather.com不太相同。 中国的天气站点id可以在这个页面上查到。比如南京ZSNJ,上海浦东ZSPD。使用weather工具查询: weather -i ZSNJ Current conditions at China (ZSNJ) 32-00N 118-48E 12M (ZSNJ) Last updated Feb 18, 2010 – 08:00 AM EST / 2010.02.18 1300 UTC Temperature: 35 F (2 C) Relative Humidity: 59% Wind: from the SSW (210 degrees) at 4 MPH (4 KT) 简化操作,可以在$HOME下创建.weatherrc文件,形如 [default] ID = ZSPD [nj] ID = ZSNJ [...]
Published at: 02:03 pm - Sunday March 01 2009
好久不写了 || 昨天看到了这么一篇介绍Gnome桌面上对地理位置的支持的文章(汗这句子)。地址在这里。 我印象中最早的就是Gnome 2.24开始那个日期applet增加的一个地图,可以选择和设置当前的location,于是有了比较好的时区支持和天气服务。文章里还提到居然Tracker搜索也支持这么一个地理元信息,可以搜出在某个地方(是说地球上的某个地方)编辑的文件。这个很强。 然后就是Empathy对location的支持了。这个看起来很强大,截图和介绍可以看这里看这里看这里。Empathy可以用来发布你evolution的联系人地址。话说,很容易就想起来了,XMPP协议有一个地理位置的扩展。不过文中说几乎除了GoogleTalk其他都支持地理位置扩展。好家伙,这个又只能遥远地YY了。 文中提到的提供LBS的库叫做Geoclue,而在Gnome上显示地图是一个叫做libchamplain的widget。而地图,当然毫无疑问是OSM了。有兴趣的朋友可以去关注。 没了,静静等待这个Empathy变得越来越强大吧。