0.6.0 • Published 9 years ago

surfsup v0.6.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

surfsup

Node module for Marine/Sailing/Surfing Weather API

the beach

Installation:

npm install surfsup

Usage:

First, you'll have to grab an API key for yourself. No need to worry, they're free. :)

https://developer.worldweatheronline.com/auth/register

Then set it as an environment variable on your machine

OSX:

export WEATHER_KEY=<your key here>

Windows:

SET WEATHER_KEY=<your key here>

Get Local Weather

var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getLocalWeather({ q: 'Teahupoo, Tahiti', format: 'json' }).then(function(response) {
  console.log(response);
});

Available Input Parameters:

ParameterTypeDescription
qstringPass Latitude/Longitude (decimal degree) of sea or ocean point
formatstringOutput format as JSON or XML
fxstring(Optional) Allows you to enable or disable normal weather output. The possible values are yes or no. By default it is yes. E.g:- fx=yes or fx=no
includeLocationstring(Optional) Returns the nearest marine weather point for which the weather data is returned for a given lat/lon value. The possible values are yes or no. By default it is no. E.g:- includeLocation=yes or includeLocation=no
callbackstring(Optional) Only to be used for json callback feature. E.g:- callback=function_name
langstring(Optional) Returns weather description text in the language of your choice. E.g:- lang=ar (Arabic). Visit Multilingual support page for more information: http://www.worldweatheronline.com/weather-api-multilingual.aspx

Get Marine Weather

var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getMarineWeather({ q: '45,-2', format: 'json' }).then(function(response) {
  console.log(response);
});

Available Input Parameters:

ParameterTypeDescription
qstringPass Latitude/Longitude (decimal degree) of sea or ocean point
formatstringOutput format as JSON or XML
fxstring(Optional) Allows you to enable or disable normal weather output. The possible values are yes or no. By default it is yes. E.g:- fx=yes or fx=no
includeLocationstring(Optional) Returns the nearest marine weather point for which the weather data is returned for a given lat/lon value. The possible values are yes or no. By default it is no. E.g:- includeLocation=yes or includeLocation=no
callbackstring(Optional) Only to be used for json callback feature. E.g:- callback=function_name
langstring(Optional) Returns weather description text in the language of your choice. E.g:- lang=ar (Arabic). Visit Multilingual support page for more information: http://www.worldweatheronline.com/weather-api-multilingual.aspx

Get Ski and Mountain Weather

var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getSkiMountainWeather({ q: 'Salt Lake City', format: 'json' }).then(function(response) {
  console.log(response);
});

Available Input Parameters:

ParameterTypeDescription
qstringPass US Zipcode, UK Postcode, Canada Postalcode, IP address, Latitude/Longitude (decimal degree) or city name
formatstringOutput format as JSON or XML
extrastring(Optional) It allows to request some additional information in the feed return. Possible values are isDayTime, utcDateTime. Two or more values can be passed as comma separated.
includeLocationstring(Optional) Returns the nearest ski and mountain weather point for which the weather data is returned for a given postcode, zipcode, city name and lat/lon values. The possible values are yes or no. By default it is no. E.g:- includeLocation=yes or includeLocation=no
callbackstring(Optional) Only to be used for json callback feature. E.g:- callback=function_name
langstring(Optional) Returns weather description text in the language of your choice. E.g:- lang=ar (Arabic). Visit Multilingual support page for more information: http://www.worldweatheronline.com/weather-api-multilingual.aspx

Get Time Zone Data

var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getTimeZoneData({ q: 'Lima, Peru', format: 'json' }).then(function(response) {
  console.log(response);
});

Available Input Parameters:

ParameterTypeDescription
qstringPass US Zipcode, UK Postcode, Canada Postalcode, IP address, Latitude/Longitude (decimal degree) or city name
formatstringOutput format as JSON or XML
callbackstring(Optional) Only to be used for json callback feature. E.g:- callback=function_name

Compile TypeScript

gulp compile

Tests

gulp tests

Issues

Issues

License

MIT License