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
38
お天気スマホアプリはもう要らない。かも。
東京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
81
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
880
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
Designing for Performance
lara
610
69k
Building Applications with DynamoDB
mza
96
6.7k
Gamification - CAS2011
davidbonilla
81
5.5k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Building Adaptive Systems
keathley
44
2.8k
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と連携 お天気スマホアプリはもう要らない。かも。