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
37
お天気スマホアプリはもう要らない。かも。
東京Node学園付属小学校 1時限目 ~Node.js入門者向けLT大会&交流会~
Chachamaru
January 15, 2016
Tweet
Share
More Decks by Chachamaru
See All by Chachamaru
色について色々と #001 - 色は認識するもの
chachmaru
0
130
おねだり企画 #1
chachmaru
0
79
Featured
See All Featured
A better future with KSS
kneath
239
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Six Lessons from altMBA
skipperchong
28
4k
Writing Fast Ruby
sferik
628
62k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
It's Worth the Effort
3n
187
28k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
Gamification - CAS2011
davidbonilla
81
5.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と連携 お天気スマホアプリはもう要らない。かも。