m0nica / flask_weather Goto Github PK
View Code? Open in Web Editor NEW☀️ ☔️ Flask app to auto-detect local weather based off of user's IP address.
Home Page: https://clima-weather.herokuapp.com/
☀️ ☔️ Flask app to auto-detect local weather based off of user's IP address.
Home Page: https://clima-weather.herokuapp.com/
If I go to https://clima-weather.herokuapp.com/
it redirects to https://clima-weather.herokuapp.com/weather/New%20York/New%20York
(https://clima-weather.herokuapp.com/weather/{city}/{state})
if I delete my session cookie this url returns a 500 error:
https://clima-weather.herokuapp.com/weather/New%20York/New%20York
(https://clima-weather.herokuapp.com/weather/{city}/{state})
Steps to reproduce:
Desired functionality:
Allow users to navigate to city/state route regardless of their ip address/location
Current route format: http://localhost:5000/weather/{LAT, LON}/{CITY}/{STATE}
Instead of displaying LAT, LON in the URL the URL should conceal LAT LON and appear as
http://localhost:5000/weather/{CITY}/{STATE}
The functionality for developers to choose temperature unit was introduced in this PR: #32. Add the ability for users to switch to celsius or fahrenheit depending on which one is displayed.
type:bug
It is not possible to sign up in dark sky :
https://blog.darksky.net
Today we have some important and exciting news to share: Dark Sky has joined Apple.
Include hourly data in the weather information that is displayed
It would be great to add a linter to this project to keep the styling uniform as this project grows. http://flake8.pycqa.org/en/latest/.
Hope this is okay, I thought it would be quite useful to toggle between the two, mostly because I'm used to celsius
Create a unit test to determine whether or not the expected weather is displayed.
Add documentation for running unit tests if it doesn't exist by the time of your PR.
We display weather icons with the weather. Some enhancements could be made to change the color of the icon to correlate with the weather (sunny i.e., orange/yellow; rain blue; snow/sleet, etc. grey).
OR display emojis instead of current weather icons
Note the types of icon text values that our current weather API returns
A machine-readable text summary of this data point, suitable for selecting an icon for display. If defined, this property will have one of the following values: clear-day, clear-night, rain, snow, sleet, wind, fog, cloudy, partly-cloudy-day, or partly-cloudy-night. (Developers should ensure that a sensible default is defined, as additional values, such as hail, thunderstorm, or tornado, may be defined in the future.)
We currently handle the following:
<i class="wi wi-day-sunny"></i>
{% elif weather_icon == "clear-night"%}
<i class="wi wi-night-clear"></i>
{% elif weather_icon == "rain"%}
<i class="wi wi-rain"></i>
{% elif weather_icon == "snow"%}
<i class="wi wi-snow"></i>
{% elif weather_icon == "sleet"%}
<i class="wi wi-sleet"></i>
{% elif weather_icon == "wind"%}
<i class="wi wi-wind"></i>
{% elif weather_icon == "fog"%}
<i class="wi wi-fog"></i>
{% elif weather_icon == "cloudy"%}
<i class="wi wi-cloudy"></i>
{% elif weather_icon == "partly-cloudy-day"%}
<i class="wi wi-forecast-io-partly-cloudy-day"></i>
{% elif weather_icon == "partly-cloudy-day"%}
<i class="wi wi-forecast-io-partly-cloudy-day"></i>
{% else %}
<i class="wi wi-day-sunny"></i>
{% endif %}
ipgetter is a utility to fetch your external IP address. It appears to be deprecated. It would be great for someone to find a suitable replacement and update.
Deployed app to Heroku and now and it appears the user's weather is not displaying and instead the server's is displaying. https://clima-weather.herokuapp.com/
In order for @jcyktor to remove the city/state from the route an extra API call was introduced in: #21
This should be updated to use a session to store the weather information so that an extra API call is not necessary
https://blog.miguelgrinberg.com/post/how-secure-is-the-flask-user-session
Add in a location drop down or another form validation way that would prevent people from including inaccurate locations
Allow strings (non-IP addresses) to translate into latitude and longitude for the weather API
Short-term fix could be to include weather for major cities
Create a unit test to determine whether or not 404 page route appears when expected.
Add documentation for running unit tests if it doesn't exist by the time of your PR.
Currently, we display rain_commentary
based on the RAIN_WARNING
. It would be great if additional commentary was added to look at RAIN_WARNING
, temperature
and maybe weather_icon
.
Creative but relevant copy enhancements are welcome! This is something that multiple people can contribute to.
Also at some point, it could be implemented so that the message varies when you refresh the page with another relevant piece of commentary for the same weather report.
rain_commentary = "there is a no chance of rain! It's a sunny day"
elif 0 < RAIN_WARNING <= .5:
rain_commentary = "there is a slight chance of rain. You might want to grab an umbrella"
elif .5 < RAIN_WARNING <.75:
rain_commentary = "there is a high chance of rain. Grab an umbrella on your way out!"
elif RAIN_WARNING == 1:
rain_commentary = "it is raining right now!"
else:
rain_commentary = "it is definitely going to rain today! GRAB YOUR UMBRELLA."
Add Travis CI integration to ensure tests have passed for all PRs
Encourage more contributions by adding a "Fork Me on GitHub" Banner. https://github.com/tholman/github-corners
http://freegeoip.net/shutdown.
The freegeoip api has been shutdown and replaced by a newer api.
Do research and add comprehensive instructions for deploying OR just link to 1 or more high quality articles with further instructions in the README.
Need to figure out how to detect Client IP in Flask application without using request
. Want the app to behave the same aside from this small but MAJOR change!
Display °C or °F after temperature depending on which unit is being used.
View this PR for more context about how temperature units are currently being used in the app:
Currently, you're calling ip-api.com for the geolocation. As a failover, please consider using the IP2Location.io API via the endpoint https://api.ip2location.io/. Our service provided 500 queries per day for keyless query, or 30000 queries per month if you sign up our free plan. You can read more on the result returned via our documentation.
Add instructions to README for running flake8 linter that was introduced in: #38
I am planning on having this app hosted on Heroku or Digital Ocean #29
However, I think the app needs a new name off of Github (and additional branding i.e., header once a name is decided).
Does anyone have thoughts as to what the name could be?
In terms of development work, there will be follow up tasks to update the website (once a name is determined)
Display weekly forecast (date, temperature and icon) smaller and below today's weather forecast.
Want to switch from using plain HTML to using React for the front-end and continue using Python/Flask to handle the logic.
Depending on the approach this can/should be broken up into smaller tasks.
Related links:
The app should have a header that says: Clima Weather
Add umbrella emoji whenever umbrellas are mentioned in the commentary
Example:
it is definitely going to rain today! GRAB YOUR UMBRELLA. ☔
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.