Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var container = {
- Bucket: 'testBucket',
- Key: '001',
- };
- exports.handler = function(event, context)
- {
- s3.getObject(container, function(err, data) {
- var zips = JSON.parse(data.Body.toString());
- for (var i = 0; i < zips.zips.length; i++) {
- var params = {
- host: 'api.openweathermap.org',
- path: '/data/2.5/weather/?apikey=mykey&zip=' + zips.zips[i].zip,
- method: 'GET'
- };
- var req = http.request(params, function(res) {
- res.on('data', function(data) {
- console.log(JSON.parse(data.toString()).coord);
- });
- });
- req.end();
- }
- });
- };
- 2017-02-21T23:19:04.539Z 229811ef-f88c-11e6-ae5f-419f2e373abe undefined
- 2017-02-21T23:19:04.817Z 229811ef-f88c-11e6-ae5f-419f2e373abe { lon: -97.01, lat: 32.71 }
- 2017-02-21T23:19:05.102Z 229811ef-f88c-11e6-ae5f-419f2e373abe { lon: -122.39, lat: 37.79 }
- 2017-02-21T23:19:05.598Z 229811ef-f88c-11e6-ae5f-419f2e373abe { lon: -122.2, lat: 47.72 }
- 2017-02-21T23:19:05.677Z 229811ef-f88c-11e6-ae5f-419f2e373abe { lon: -122.19, lat: 47.68 }
- 2017-02-21T23:18:41.575Z 14fd6753-f88c-11e6-9329-f35b8d3222e0 undefined
- 2017-02-21T23:18:41.585Z 14fd6753-f88c-11e6-9329-f35b8d3222e0 undefined
- 2017-02-21T23:18:41.758Z 14fd6753-f88c-11e6-9329-f35b8d3222e0 { lon: -122.09, lat: 37.39 }
- 2017-02-21T23:18:41.796Z 14fd6753-f88c-11e6-9329-f35b8d3222e0 { lon: -122.2, lat: 47.72 }
- 2017-02-21T23:18:41.802Z 14fd6753-f88c-11e6-9329-f35b8d3222e0 { lon: -97.01, lat: 32.71 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement