Skip to content

Commit

Permalink
docs: openweathermap service
Browse files Browse the repository at this point in the history
  • Loading branch information
hywax committed Feb 1, 2024
1 parent 9363ae4 commit 1b42cb2
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ The basic concept of `Mafl` is to create not just a homepage, but to create an i
List of services:
* **[Base](https://mafl.hywax.space/services/base.html)** - The main card of the service. Other services are created on the basis of this service.
* **[IP API](https://mafl.hywax.space/services/ip-api.html)** - Shows information about your IP address.
* **[Weather](https://mafl.hywax.space/services/weather.html)** - Shows weather information for your location.

## 🎨 Themes

Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default defineConfig({
items: [
{ text: 'Base', link: '/base' },
{ text: 'IP API', link: '/ip-api' },
{ text: 'Weather', link: '/openweathermap' },
],
},
{
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default defineConfig({
items: [
{ text: 'Базовый', link: '/base' },
{ text: 'IP API', link: '/ip-api' },
{ text: 'Погода', link: '/openweathermap' },
],
},
{
Expand Down
Binary file added docs/public/services/openweathermap-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/services/openweathermap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions docs/ru/services/openweathermap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Open Weather Map <in-version value="0.9.0" />

<preview-service name="openweathermap" />

Получает данные о погоде с сервиса [Open Weather Map](https://openweathermap.org/).

<!--@include: ../_parts/extends-base-service.md-->

## Широта и долгота

Для получения данных о погоде необходимо указать широту и долготу. Эти данные можно получить с помощью сервиса [LatLong](https://www.latlong.net/).

```yaml
options:
lat: 51.5085
lon: -0.1257
```

## Единицы измерения

Подробнее о единицах измерения можно прочитать в [документации](https://openweathermap.org/weather-data).

```yaml
options:
units: metric
```

Поддерживаемые значения: `metric`, `imperial`, `standard`

Значение по умолчанию: `metric`

## API ключ

API ключ можно получить в личном кабинете [Open Weather Map](https://home.openweathermap.org/api_keys).

```yaml
secrets:
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
```

<!--@include: ../_parts/secrets-safety.md-->

## Примеры

### Базовый сервис

::: code-group
```yaml [config.yml]
services:
- type: openweathermap
options:
lat: 51.5085
lon: -0.1257
secrets:
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
```
:::

### Имперская система

::: code-group
```yaml [config.yml]
services:
- type: openweathermap
options:
lat: 51.5085
lon: -0.1257
units: imperial
secrets:
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
```
:::
72 changes: 72 additions & 0 deletions docs/services/openweathermap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Open Weather Map <in-version value="0.9.0" />

<preview-service name="openweathermap" />

Weather data is received from [Open Weather Map](https://openweathermap.org/).

<!--@include: ../_parts/extends-base-service.md-->

## Latitude and longitude

For weather data, you need to specify the latitude and longitude. This data can be obtained using the [LatLong](https://www.latlong.net/) service.

```yaml
options:
lat: 51.5085
lon: -0.1257
```

## Units

Read more about units of measurement in the [documentation](https://openweathermap.org/weather-data).

```yaml
options:
units: metric
```

Values: `metric`, `imperial`, `standard`

Default: `metric`

## API key

API key can be obtained in the personal account of [Open Weather Map](https://home.openweathermap.org/api_keys).

```yaml
secrets:
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
```

<!--@include: ../_parts/secrets-safety.md-->

## Examples

### Base service

::: code-group
```yaml [config.yml]
services:
- type: openweathermap
options:
lat: 51.5085
lon: -0.1257
secrets:
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
```
:::

### Imperial units

::: code-group
```yaml [config.yml]
services:
- type: openweathermap
options:
lat: 51.5085
lon: -0.1257
units: imperial
secrets:
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
```
:::

0 comments on commit 1b42cb2

Please sign in to comment.