Google Latitude與天氣http://www.hksilicon.com/kb/articles/28783/Google-Latitude

經常會有一些沒有用的想法,這次是打算把Google Latitude和天氣預報結合起來。顯示用戶實時所在地的天氣信息。
實現起來非常簡單,首先從Google Latitude獲得JSON信息,https://www.google.com/latitude/apps/badge/api?user=-X&type=json,其中X為用戶的19位Google Latitude ID。
例如我的Google Latitude JSON信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | { "type": "FeatureCollection",
"features": [
{ "type": "Feature",
"geometry": {"type": "Point", "coordinates": [18.0248728, 59.3828018]},
"properties": {
"id": "-X",
"accuracyInMeters": 60,
"timeStamp": 1296208549,
"reverseGeocode": "Solna Municipality, Sweden",
"photoUrl": "https://www.google.com/latitude/apps/badge/api?type=photo&photo=",
"photoWidth": 96,
"photoHeight": 96,
"placardUrl": "https://www.google.com/latitude/apps/badge/api?type=photo_placard&photo=r&moving=false&stale=false&lod=1&format=png",
"placardWidth": 56,
"placardHeight": 59
}
}
]
}
|
使用wunderground的api獲得當時的天氣信息的XML
http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=59.3829104,18.0248496
沒有留言:
張貼留言