weather-yahoo
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "weather-yahoo", | ||
"version": "1.0.0", | ||
"description": "Search by location, it gives you the weather", | ||
"version": "1.0.1", | ||
"description": "Search by location to get weather info from Yahoo", | ||
"author": "Kevin Walchko", | ||
@@ -6,0 +6,0 @@ "main": "yahoo-weather.js", |
# Yahoo Weather | ||
[![npm](https://img.shields.io/npm/v/weather-yahoo.svg)](https://github.com/walchko/weather-yahoo) | ||
[![npm](https://img.shields.io/npm/l/weather-yahoo.svg)](https://github.com/walchko/weather-yahoo) | ||
[![Travis](https://img.shields.io/travis/walchko/weather-yahoo.svg)](https://travis-ci.org/walchko/weather-yahoo) | ||
[![NPM](https://nodei.co/npm/weather-yahoo.png)](https://nodei.co/npm/weather-yahoo/) | ||
There are a ton of yahoo weather modules, mine allows access to all of the information or | ||
just a subset. | ||
# Usage | ||
## Usage | ||
To test it out, put the below code into Tonic and see the results, however, give it time | ||
(a few seconds) to talk with yahoo servers and return an answer. | ||
var yw = require('weather-yahoo'); | ||
@@ -20,2 +29,15 @@ var ans = {}; | ||
Also, Yahoo has a great [developer network](https://developer.yahoo.com/weather/) where you | ||
can play with code and see the full json format they return. | ||
## Examples | ||
See the [example](https://github.com/walchko/yahoo-weather/blob/master/example/example.js) | ||
to play with the output. | ||
## Change Log | ||
| Version | Date | Comments | | ||
|---------|----------|----------| | ||
| 1.0.1 | 11 Jan 16| clean up and doc updates | | ||
| 1.0.0 | 10 Jan 16| Finally published it to npm | |
@@ -189,37 +189,2 @@ "use strict"; | ||
// | ||
// // returns a simple json response | ||
// YahooWeather.prototype.getSimpleWeather = function (location) { | ||
// return new Promise( function(response,reject){ | ||
// // var locationQuery = escape("select item from weather.forecast where woeid in (select woeid from geo.places where text='" + location + "') and u='f'"); | ||
// // var locationUrl = "https://query.yahooapis.com/v1/public/yql?q=" + locationQuery + "&format=json"; | ||
// // | ||
// // https.get(locationUrl, function (res) { | ||
// // res.setEncoding('binary'); | ||
// // | ||
// // var resData = ""; | ||
// // res.on('data', function (chunk) { | ||
// // return resData += chunk; | ||
// // }); | ||
// // res.on('end', function () { | ||
// // var result = JSON.parse(resData); | ||
// | ||
// getAllWeather(location).then( function(result){ | ||
// | ||
// if (Array.isArray(result.query.results.channel)) { | ||
// var returnMessage = result.query.results.channel[0].item.title + '\n`Current` ' + result.query.results.channel[0].item.condition.temp + ' degrees, ' + result.query.results.channel[0].item.condition.text + '\n`' + result.query.results.channel[0].item.forecast[0].day + '` High: ' + result.query.results.channel[0].item.forecast[0].high + ' Low: ' + result.query.results.channel[0].item.forecast[0].low + ', ' + result.query.results.channel[0].item.forecast[0].text + '\n`' + result.query.results.channel[0].item.forecast[1].day + '` High: ' + result.query.results.channel[0].item.forecast[1].high + ' Low: ' + result.query.results.channel[0].item.forecast[1].low + ', ' + result.query.results.channel[0].item.forecast[1].text; | ||
// response(returnMessage); | ||
// } else { | ||
// var returnMessage = result.query.results.channel.item.title + '\n`Current` ' + result.query.results.channel.item.condition.temp + ' degrees, ' + result.query.results.channel.item.condition.text + '\n`' + result.query.results.channel.item.forecast[0].day + '` High: ' + result.query.results.channel.item.forecast[0].high + ' Low: ' + result.query.results.channel.item.forecast[0].low + ', ' + result.query.results.channel.item.forecast[0].text + '\n`' + result.query.results.channel.item.forecast[1].day + '` High: ' + result.query.results.channel.item.forecast[1].high + ' Low: ' + result.query.results.channel.item.forecast[1].low + ', ' + result.query.results.channel.item.forecast[1].text; | ||
// response(returnMessage); | ||
// } | ||
// | ||
// }); | ||
// // }); | ||
// // }); | ||
// | ||
// }); | ||
// }; | ||
// module.exports.YahooWeather = new YahooWeather(); | ||
module.exports = new YahooWeather(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10973
5
254
43