- This repo has 3 braches.
- master: weather API
- merge_interval: a tail recursion algorithm of merging a list of interval.
- stack_tower: algorithm for stacking a bunch of books in to a stable tower.
- A worker that fetches the current weather data for HK and SG every minute.
- Store the temperature and humidity, etc data with timestamps in MongoDB
- Provide a RESTFUL API endpoint to query the weather data from the database.
- Backend: Website
- Linkedin Profile: [https://www.linkedin.com/in/craaronyang/]
- Flask + MongoDB + Python
- Collect weather data from pyowm.
- Prepare and process data, store the data into MongoDB.
- make sure mongodb > 3.4 is installed and running
- git clone this repo
- pip3 install -r dev-requirement.txt OR pip3 install flask pymongo -y
- pip3 install pyowm
$/path/to/python3 worker.py
$/path/to/python3 app.py
- http://13.59.162.183:8000/weather?city=HK
- http://13.59.162.183:8000/weather?city=HK&start=2017-11-23T04:08:05&end=2017-12-24T04:08:05
- http://13.59.162.183:8000/weather?city=HK&start=2017-13-23T04:08:05&end=2017-15-24T04:08:05
- http://13.59.162.183:8000/weather?city=HK&start=2017-11-13T04:08:05&end=2017-12-24T04:08:05
- http://13.59.162.183:8000/weather?city=HK&start=2017-11-13T04:08:05&end=2017-10-24T04:08:05
- http://13.59.162.183:8000/weather?city=SG&start=2017-11-13T04:08:05&end=2017-10-24T04:08:05
- http://13.59.162.183:8000/weather?city=H