New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@eyedea-sockets/openweathermap

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eyedea-sockets/openweathermap

Integration with OpenWeatherMap API

canary
latest
Source
npmnpm
Version
0.1.8
Version published
Maintainers
2
Created
Source

Syncano Socket for OpenWeatherMap

Syncano Socket CircleCI branch Codecov branch JavaScript Style Guide npm license

Main Socket features:

  • openweathermap/get-temperature — current temperature for the city
  • openweathermap/get-three-hours — 3 hours forecast for the city

Getting Started

Install package in your project:

cd my_project
npm install @syncano/cli --save-dev
npm install @eyedea-sockets/openweathermap --save
npx s deploy

Use it:

import Syncano from @syncano/core

const s = new Syncano(<instaneName>)

// Temperature for the given city
const cityTemp = await s.get('openweathermap/get-temperature', {city: 'Oslo'})

// Three hours forecast for given city
const forecast = await s.get('openweathermap/get-three-hours', {city: 'Oslo'})

Endpoints

openweathermap/get-temperature

Input:

ParameterTypeRequiredExample
citystringYesOslo

Outputs:

success - Operation Successful

  • Code: 200
  • Mimetype: application/json
ParameterTypeDescriptionExample
tempfloatCurrent City Temp-12.2

fail - Operation failed

  • Code: 400
  • Mimetype: application/json
ParameterTypeDescriptionExample
messagestringError messageInternal error.

openweathermap/get-three-hours

Input:

ParameterTypeRequiredExample
citystringYesOslo

Outputs:

success - Operation Successful

  • Code: 200
  • Mimetype: application/json
TypeDescriptionExample
arrayThree hours forecast[{"forecast": "Clouds", "hour": "5 PM"}, {"forecast": "Clear", "hour": "8 PM"}, {"forecast": "Clear", "hour": "11 PM"}]

fail - Operation failed

  • Code: 400
  • Mimetype: application/json
ParameterTypeDescriptionExample
messagestringError messageInternal error.

Keywords

syncano

FAQs

Package last updated on 11 Jul 2018

Related posts