Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
お天気スマホアプリはもう要らない。かも。
Search
Chachamaru
January 15, 2016
0
33
お天気スマホアプリはもう要らない。かも。
東京Node学園付属小学校 1時限目 ~Node.js入門者向けLT大会&交流会~
Chachamaru
January 15, 2016
Tweet
Share
More Decks by Chachamaru
See All by Chachamaru
色について色々と #001 - 色は認識するもの
chachmaru
0
120
おねだり企画 #1
chachmaru
0
65
Featured
See All Featured
Web development in the modern age
philhawksworth
202
10k
Being A Developer After 40
akosma
61
580k
Adopting Sorbet at Scale
ufuk
68
8.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
Atom: Resistance is Futile
akmur
259
25k
What's new in Ruby 2.0
geeforr
337
31k
KATA
mclloyd
15
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
122
39k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
19
1.7k
Making the Leap to Tech Lead
cromwellryan
124
8.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
Transcript
ちゃちゃまる 見習いデザインエンジニア 高校生 @chachmaru LIGブログの読者層を下げる
天気予報スマホアプリはもう遅い! (かも!)
None
Livedoor - Weather Hacks "forecasts" : [ { "dateLabel" :
"ࠓ", "telop" : "ͷͪಶ", "date" : "2015-01-15", "temperature" : { "min" : null, "max" : { "celsius" : "11", "fahrenheit" : "51.8" } }, "image" : { "width" : 50, "url" : "http://weather.livedoor.com/img/icon/5.gif", "title" : "ͷͪಶ", "height" : 31 } }
var http = require('http'); var url = 'http://weather.livedoor.com/forecast/webservice/json/v1? city=130010'; http.get(url,
function(res) { var body = ''; res.setEncoding('utf8'); res.on('data', function(data) { body += data; }); res.on('end', function(data) { console.log(JSON.parse(body).forecasts[0].telop); }) });
var url = 'http://weather.livedoor.com/forecast/webservice/json/v1?city=130010';
var weather = '';
http.get(url, function(res) {}
res.setEncoding('utf8');
res.on('data', function(data) {});
var body = ''; res.on('data', function(data) { body += data;
});
"forecasts" : [ { "dateLabel" : "ࠓ", "telop" : "ͷͪಶ",
"date" : "2015-01-15", "temperature" : { "min" : null, "max" : { "celsius" : "11", "fahrenheit" : "51.8" } }, "image" : { "width" : 50, "url" : "http://weather.livedoor.com/img/icon/5.gif", "title" : "ͷͪಶ", "height" : 31 } }
res.on('end', function(data) {}
res.on('end', function(data) { var weather_data = JSON.parse(body); forecasts = weather_data['forecasts'];
}
res.on('end', function(data) { var weather_data = JSON.parse(body); forecasts = weather_data['forecasts'];
for (index in forecasts) { forecast = forecasts[index]; if (forecast.dateLabel === 'ࠓ') { weather = forecast['telop']; console.log(weather); } } })
IoTと連携 お天気スマホアプリはもう要らない。かも。