git ssb

0+

Dominic / weather



Commit 73e597787040ac71ae3842007ec3d7b30a672619

oops, actually count winds, also better structure

Dominic Tarr committed on 9/24/2018, 8:44:57 AM
Parent: e6ce43fadfd737b2a52d0225424c5eb186e6e6b3

Files changed

db.jschanged
db.jsView
@@ -89,9 +89,10 @@
8989 var fstate = state[forecast.name] = state[forecast.name] || {}
9090 var wstate = fstate[forecast.month] = fstate[forecast.month] || {winds: {}, count: 0}
9191 forecast.winds.forEach(function (w) {
9292 var wind = w.direction+' '+w.strength
93- wstate.winds[wind] = (wstate[wind] || 0) + 1
93 + wstate.winds[w.direction] = wstate.winds[w.direction] || {}
94 + wstate.winds[w.direction][w.strength] = (wstate.winds[w.direction][w.strength] || 0) + 1
9495 wstate.count ++
9596 })
9697
9798 if(Date.now() > ts + 10000) {
@@ -131,4 +132,5 @@
131132 console.log(JSON.stringify(data, null, 2))
132133 })
133134
134135
136 +

Built with git-ssb-web