{"id":19347665,"url":"https://github.com/datarhei/clappr-weather","last_synced_at":"2026-05-14T08:33:48.781Z","repository":{"id":42699927,"uuid":"210430544","full_name":"datarhei/clappr-weather","owner":"datarhei","description":"Weather plugin for Clappr player","archived":false,"fork":false,"pushed_at":"2023-03-05T14:14:13.000Z","size":1367,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-06T14:44:32.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datarhei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-09-23T18:59:16.000Z","updated_at":"2022-10-24T02:03:24.000Z","dependencies_parsed_at":"2023-09-22T22:03:00.497Z","dependency_job_id":null,"html_url":"https://github.com/datarhei/clappr-weather","commit_stats":{"total_commits":26,"total_committers":2,"mean_commits":13.0,"dds":0.1923076923076923,"last_synced_commit":"15167304e77e23473fd3927f1fc678a5e74e73f3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datarhei%2Fclappr-weather","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datarhei%2Fclappr-weather/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datarhei%2Fclappr-weather/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datarhei%2Fclappr-weather/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datarhei","download_url":"https://codeload.github.com/datarhei/clappr-weather/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240457943,"owners_count":19804489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T04:17:32.659Z","updated_at":"2025-11-17T08:04:47.856Z","avatar_url":"https://github.com/datarhei.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clappr-weather\n\nDisplays the current weather information in an overlay at the top of the player. The weather data is only displayed when\nplaying and hides when stopped.\n\n![Snapshot](../master/screenshot.jpg)\n\n## TODO\n\n- ICONS!!!!\n- Nicer styling\n\n## Config\n\n```\nvar player = new Clappr.Player({\n\t...\n\n\tplugins: [Weather],\n\n\tweatherConfig: {\n\t\turl: 'https://example.com/weather/data.json'\n\t},\n\n\t...\n});\n```\n\nBy default the weather data will be updated ever 5 seconds. You can override this by providing an alternative interval\nin the `weatherConfig`:\n\n```\nweatherConfig: {\n\turl: 'https://example.com/weather/data.json',\n\trefresh: 60\n},\n```\n\nThis will refresh the weather data every 60 seconds.\n\nBy default the weather data is displayed in metric units. You can override this by setting the value for `units` to `imperial`:\n\n```\nweatherConfig: {\n\turl: 'https://example.com/weather/data.json',\n\tunits: 'imperial'\n},\n```\n\n## Data format\n\nThe expected data format for the weather data has to be JSON and has the form\n\n```json\n{\n\t\"windspeed_ms\": 1.5,\n\t\"winddirection\": 253,\n\t\"temperature_c\": 10.5,\n\t\"humidity\": 81,\n\t\"pressure_hpa\": 1021.77,\n\t\"precipitation\": {\n\t\t\"value_mm\": 0.0,\n\t\t\"mode\": \"rain\",\n\t},\n\t\"timestamp\": 1602503869,\n}\n```\n\nThe values are expected to be in the metric system.\n\n\u003e Vincent: \"No man, they got the metric system. They wouldn't know what the f**k a quarter pounder is.\"\n\u003e Jules: \"Then what do they call it?\"\n\u003e Vincent: \"They call it a Royale with cheese.\"\n\nField | Unit | Description\n------|------|------------\n`windspeed_ms` | `m/s` | The wind speed in meters per second.\n`winddirection` | `°` | The direction the wind is coming from. Values from `0` to `359`.\n`temperature_c` | `°C` | The temperature in degress Celsius.\n`humidity` | `%` | The relative air humidity.\n`pressure_hpa` | `hpa` | The atmospheric pressure in hpa.\n`precipitation.value_mm` | `mm` | The precipitation in millimeter.\n`precipitation.mode` | | One value of `none`, `rain`, `snow`.\n`timestamp` | | Unix timestamp of the measurement.\n\nIf the server where you load the data from delivers the data in a different format, you can define a rewrite function in the config\nthat will transform the output into the expected form. The function expects one parameter which is a JavaScript object and will return\nan object in the above mentioned form. The default for the rewrite function is `null` which means that no rewrite will happen.\n\nHere is an example that rewrites the data from [openweathermap.org](https://openweathermap.org/api):\n\n```js\nvar player = new Clappr.Player({\n\t...\n\n\tplugins: [Weather],\n\n\tweatherConfig: {\n\t\turl: 'https://example.com/weather/data.json',\n\t\trewrite: function(data) {\n\t\t\tvar d = {\n\t\t\t\t\"windspeed_ms\": data.wind.speed,\n\t\t\t\t\"winddirection\": data.wind.deg,\n\t\t\t\t\"temperature_c\": data.main.temp,\n\t\t\t\t\"humidity\": data.main.humidity,\n\t\t\t\t\"pressure_hpa\": data.main.pressure,\n\t\t\t\t\"precipitation\": {\n\t\t\t\t\t\"value_mm\": 0.0,\n\t\t\t\t\t\"mode\": \"none\",\n\t\t\t\t},\n\t\t\t\t\"timestamp\": data.dt\n\t\t\t};\n\n\t\t\tif ('rain' in data) {\n\t\t\t\td.precipitation.value_mm = data.rain.rain_1h;\n\t\t\t\td.precipitation.mode = \"rain\";\n\t\t\t}\n\t\t\telse if ('snow' in data) {\n\t\t\t\td.precipitation.value_mm = data.snow.snow_1h;\n\t\t\t\td.precipitation.mode = \"snow\";\n\t\t\t}\n\n\t\t\treturn d;\n\t\t}\n\t},\n\n\t...\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarhei%2Fclappr-weather","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatarhei%2Fclappr-weather","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarhei%2Fclappr-weather/lists"}