Skip to content

Commit

Permalink
Added instructions for API integration
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaCarroll committed Jul 17, 2016
1 parent 6a13a7d commit 1f1b7e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
23 changes: 23 additions & 0 deletions README-API-WeatherUnderground.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Weather Underground API integration
===================================

1. Run the SQL statement again. This is written in such a way that it will only add whatever you don't have.

`mysql -u root -p weather < CREATE-SP.sql`

2. Add your own values to the settings table.

```
mysql -u root -p weather -e "update SETTINGS set value='YOUR-STATION-ID' where name='WUNDERGROUND_ID'"
mysql -u root -p weather -e "update SETTINGS set value='YOUR-STATION-PASSWORD' where name='WUNDERGROUND_PASSWORD'"
```
3. Open CRONTAB to configure a recurring task.
`crontab -e`
4. Set up a CRON job to automatically send data to Weather Underground every 10 minutes. (Change the URL to match your environment.)
`*/10 * * * * curl http://localhost/dashboard/wunderground-api.php`
5. Press `Ctrl O` then `Enter` to save and `Ctrl X` to quit nano.
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,7 @@ You should now be in `/var/www/html/dashboard`

### Set up external API's (optional)

- Weather Underground
-- Populate WUNDERGROUND_ID and WUNDERGROUND_PASSWORD in the Settings table.
-- Open crontab for editing.

`crontab -e`

-- Copy this line and paste it into CRON:

`*/10 * * * * curl http://localhost/dev/wunderground-api.php`

Press `Ctrl O` then `Enter` to save and `Ctrl X` to quit nano.
- Weather Underground: See [README-API-WeatherUnderground.md](README-API-WeatherUnderground.md).

----------

Expand Down

0 comments on commit 1f1b7e8

Please sign in to comment.