Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ajmeese7/where-temperature

Find a location that is currently in your desired temperature range.
https://github.com/ajmeese7/where-temperature

location temperature weather

Last synced: about 1 month ago
JSON representation

Find a location that is currently in your desired temperature range.

Awesome Lists containing this project

README

        


⛈️Where Temperature⛈️



JavaScript


License


Stars


Forks


Leave a Star!

Find a location that is currently in your desired temperature range.



Project Preview

## Developing
You can replicate the PostgreSQL table structure by running the following query
on your local Postgres server:

```sql
CREATE TABLE data (
id SERIAL PRIMARY KEY,
weather_data text,
date TIMESTAMP default CURRENT_TIMESTAMP
);
```

To start up the Express server, run `npm run devstart`. This will start it with
Nodemon, so the server will automatically restart whenever you make changes to
important files. You can view it at `localhost:5000`.

To start a local Postgres server, run `psql postgresql://[user[:password]@][netloc][:port][/dbname]`,
filling in your server's information where appropriate.

You should create a `.env` file with the following values assigned:
- DATABASE_URL
- OPEN_WEATHER_MAP_API_KEY
- This project uses the [Current Weather API](https://openweathermap.org/current#min) from
Open Weather Map to get the weather data.
- You can sign up for a free API key [here](https://home.openweathermap.org/api_keys).

**NOTE:** The project is coded to retrieve new data if the Postgres data is older
than five minutes. However, the server's time zone may differ from yours, so it may
unnecessarily retrieve new data, or it may not gather new data when it should. I
am currently unaware of an easy solution to this, without gathering new data on
automatic intervals, so suggestions are welcome.