-
Notifications
You must be signed in to change notification settings - Fork 341
Description
Rewrite the weather module to scrape a site which supports countries outside of US.
Requirements:
- Continue using ipinfo.io for keyless api access to current location
- Scrape weather site (do not use an API key)
- Continue getting forecast to produce appropriate emoji
- Continue getting temperature (option of F or C)
Currently thinking the best site to scrape is wunderground.com because they have a simple url structure: wunderground.com/weather/region_code/city. It looks like in the US it takes region_code as the two letter code of your state. Otherwise, it seems to expect your country code.
For example, Vancouver, British Columbia, Canada is:
wunderground.com/weather/ca/vancouver
whereas Seattle, Washington, United States is:
wunderground.com/weather/us/wa/seattle
I think this would work, the only challenge I see is that ipinfo.io doesn't seem to give region code, only the full region name and then the country code. However, currently I am getting the state/region code by scraping another website. Since it is only the US it might be worth just making a look up table to translate them.
If anyone has any other thoughts on this let me know!