thisdavej/weather
Weather Service
  README.md
# Weather Service This service retrieves real-time weather information. It is described in more detail in my tutorial on [Consuming Web API JSON Data Using curl and jq](http://thisdavej.com/consuming-web-api-json-data-using-curl-and-jq/). There are currently two functions available: ## current (default function) - Get current weather conditions for a given city ### Parameters #### Keyword arguments - loc: location (example: San Diego, CA) - deg: degree type (F or C) Default is F. ### Usage #### Command line Return a JSON object with the current weather info: ```bash $ lib thisdavej.weather.current --loc "San Diego, CA" ``` This command returns the following JSON object: ```JSON { temperature: '63', skycode: '31', skytext: 'Clear', date: '2016-11-25', observationtime: '17:35:00', observationpoint: 'San Diego, CA', feelslike: '63', humidity: '61', winddisplay: '2 mph Southwest', day: 'Friday', shortday: 'Fri', windspeed: '2 mph', imageUrl: 'http://blob.weather.microsoft.com/static/weather4/en-us/law/31.gif', degType: 'F' } ``` #### HTTP GET Return a JSON object with the current weather info (deg C) ```http https://f.stdlib.com/thisdavej/weather/current?loc=San Diego, CA&deg=C ``` #### Web and Node.js ```js const f = require('f'); f('thisdavej/weather/current')({loc: 'San Diego, CA', deg: 'C' }, (err, response) => { // handle error or response }); ``` ## forecast - Get forecast weather conditions for a given city ### Parameters #### Keyword arguments - loc: location (example: San Diego, CA) - deg: degree type (F or C) Default is F. ### Usage #### Command line Return a JSON object with the forecast weather info: ```bash $ lib thisdavej.weather.forecast --loc "San Diego, CA" ``` This command returns the following JSON object: ```JSON [ { low: '47', high: '76', skycodeday: '31', skytextday: 'Clear', date: '2016-11-24', day: 'Thursday', shortday: 'Thu', precip: '0', degType: 'F' }, { low: '54', high: '72', skycodeday: '32', skytextday: 'Sunny', date: '2016-11-25', day: 'Friday', shortday: 'Fri', precip: '0', degType: 'F' }, { low: '57', high: '64', skycodeday: '28', skytextday: 'Mostly Cloudy', date: '2016-11-26', day: 'Saturday', shortday: 'Sat', precip: '80', degType: 'F' }, { low: '53', high: '65', skycodeday: '9', skytextday: 'Light Rain', date: '2016-11-27', day: 'Sunday', shortday: 'Sun', precip: '80', degType: 'F' }, { low: '54', high: '64', skycodeday: '30', skytextday: 'Partly Sunny', date: '2016-11-28', day: 'Monday', shortday: 'Mon', precip: '50', degType: 'F' } ] ``` #### HTTP GET Return a JSON object with the forecast weather info (deg C) ```http https://f.stdlib.com/thisdavej/weather/forecast?loc=San Diego, CA&deg=C ``` #### Web and Node.js ```js const f = require('f'); f('thisdavej/weather/forecast')({loc: 'San Diego, CA', deg: 'C' }, (err, response) => { // handle error or response }); ``` ## Author [Dave Johnson](http://thisdavej.com/) ([@thisDaveJ](https://twitter.com/thisDaveJ))
  Published by thisdavej on Friday, January 27th, 2017, 10:10:32 PM
  Rate limits
Auth rate limit
 
requests
 
Unauth rate limit
 
requests
 
This service has 2 functions
  current default function
  Pricing
 per request
 per second
  Current weather conditions
   Arguments
No Arguments Expected
   Keyword Arguments
deg Degree type (F or C) Default is F
loc Location name or zip code
  forecast
  Pricing
 per request
 per second
  Forecast weather conditions
   Arguments
No Arguments Expected
   Keyword Arguments
deg Degree type (F or C) Default is F
loc Location name or zip code