# @eyedea-sockets/openweathermap

> Integration with OpenWeatherMap API

Latest version **0.1.8** (published 2018-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @eyedea-sockets/openweathermap
pnpm add @eyedea-sockets/openweathermap
yarn add @eyedea-sockets/openweathermap
bun add @eyedea-sockets/openweathermap
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2018-07-11 |
| First published | 2018-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 802.6 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Syncano |
| Maintainers | idered, qk |
| Keywords | syncano, socket, openweathermap, weather |

## Links

- npm: https://www.npmjs.com/package/@eyedea-sockets/openweathermap
- Repository: https://github.com/eyedea-io/syncano-socket-openweathermap
- Homepage: https://github.com/eyedea-io/syncano-socket-openweathermap#readme
- Issues: https://github.com/eyedea-io/syncano-socket-openweathermap/issues
- npm.io page: https://npm.io/package/@eyedea-sockets/openweathermap

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.18.0
- [@syncano/core](https://npm.io/package/@syncano/core.md) 0.13.0-alpha.f6ea95d4
- [@syncano/validate](https://npm.io/package/@syncano/validate.md) 0.13.0-alpha.f6ea95d4

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.8 (latest) — 2018-07-11
- 0.1.6 — 2018-07-11
- 0.1.5 — 2018-07-11
- 0.1.4 — 2018-07-11
- 0.1.3 — 2018-07-11
- 0.1.2 — 2018-04-11
- 0.1.1 — 2018-04-11
- 0.1.0 — 2018-04-11

## README

# Syncano Socket for OpenWeatherMap

[![Syncano Socket](https://img.shields.io/badge/syncano-socket-blue.svg)](https://syncano.io)
[![CircleCI branch](https://img.shields.io/circleci/project/github/eyedea-io/syncano-socket-openweathermap/master.svg)](https://circleci.com/gh/eyedea-io/syncano-socket-openweathermap/tree/master)
![Codecov branch](https://img.shields.io/codecov/c/github/eyedea-io/syncano-socket-openweathermap/master.svg)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![npm](https://img.shields.io/npm/dw/@eyedea-sockets/openweathermap.svg)](https://www.npmjs.com/package/@eyedea-sockets/)
![license](https://img.shields.io/github/license/eyedea-io/syncano-socket-openweathermap.svg)

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:

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

Use it:

```js
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:

| Parameter | Type   | Required  | Example   |
|-----------|--------|-----------|-----------|
| city      | string | Yes       | `Oslo`    |

#### Outputs:

**success** - **Operation Successful**

- Code: 200
- Mimetype: application/json

| Parameter | Type   | Description           | Example      |
|-----------|--------|-----------------------|--------------|
| temp      | float  | Current City Temp     | `-12.2`      |


**fail** - **Operation failed**

- Code: 400
- Mimetype: application/json

| Parameter | Type   | Description            | Example              |
|-----------|--------|------------------------|----------------------|
| message   | string | Error message          | `Internal error.`    |

### openweathermap/get-three-hours

#### Input:

| Parameter | Type   | Required  | Example   |
|-----------|--------|-----------|-----------|
| city      | string | Yes       | `Oslo`    |

#### Outputs:

**success** - **Operation Successful**

- Code: 200
- Mimetype: application/json

| Type   | Description           | Example      |
|--------|-----------------------|--------------|
| array  | Three 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

| Parameter | Type   | Description            | Example                 |
|-----------|--------|------------------------|-------------------------|
| message   | string | Error message          | `Internal error.`       |

---
_Source: https://npm.io/package/@eyedea-sockets/openweathermap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
