Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bnhovde/weathermole
Simple weather app written in React
https://github.com/bnhovde/weathermole
Last synced: 13 days ago
JSON representation
Simple weather app written in React
- Host: GitHub
- URL: https://github.com/bnhovde/weathermole
- Owner: bnhovde
- Created: 2016-06-18T13:08:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-18T13:09:17.000Z (over 8 years ago)
- Last Synced: 2023-08-30T23:19:50.841Z (over 1 year ago)
- Language: CSS
- Homepage:
- Size: 2.58 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### WeatherMole
> Because why not?
React, ES6, Weather!
[Live Demo](https://bardhovde.com/weather/)
* Shows you weather & local time for a given location
* Daily hourly breakdown view
* 7-day forecast view
* Changes colour based on time at location (day/night/dawn/dusk)
* It's got a mole### Requirements
PHP 5.3.2+
Composer
node (latest)### Local installation
* `npm install`
* Composer install (`php composer.phar install`)
* Register with [forecast.io](http://forecast.io) to get your api key
* Make a copy of config/config.sample.php and fill in your correct API_KEY
* Make the /api folder accessible via apache/nginx
* In `webpack.config.js`, replace proxy/target with the apache/nginx api url### Developing
* `npm run dev` to serve local dev version
### Deploying
* `npm run prod` to create the dist version.
### API
The php API is built with slimPHP and located in the `api` folder.
The API has the following endpoints:
* `/location/{location name}` - Returns lat/long coordinates for a location:
```
{
"lat": -33.9248685,
"lng": 18.4240553
}
```
* `/forecast/{latitude},{longitude}` - Returns the forecast for a location:
```
{
"time": 12:00,
"temp": 14,
"icon": 'rain-day',
"daylight": "day",
"summary": 'Heavy rain all day',
"day": [
{ "time": 00:00, "icon": 'clear-night', "temp": 11}
{ "time": 01:00, "icon": 'clear-night', "temp": 12}
...
],
"week": [
{ "date": 13/4, "icon": 'clear-night', "temp": 11}
{ "date": 14/4, "icon": 'clear-night', "temp": 12}
...
]
}
```### Limitations
The google location lookup limit is `2,500` per day
The forecast.io lookup limit is `1000` per day### Credits
Uses the awesome "Clean weather icons" by [www.artill.de](http://www.artill.de)