""" Using requests module to get the weather """
import requests

loc_url = "http://ipinfo.io/loc"
WEATHER_URL = "http://wttr.in/"

res = requests.get(loc_url)

# decode to unicode string and strip() to remove '\n' character
# print(res.content.decode("utf-8").strip())
loc = res.content.decode("utf-8").strip()

res = requests.get(WEATHER_URL + loc)

print(res.content.decode("utf-8"))

3a7c279cd9941a15edc9a5c5001f22031ee78080
<mask token>

<mask token>
print(res.content.decode('utf-8'))

<mask token>
loc_url = 'http://ipinfo.io/loc'
WEATHER_URL = 'http://wttr.in/'
res = requests.get(loc_url)
loc = res.content.decode('utf-8').strip()
res = requests.get(WEATHER_URL + loc)
print(res.content.decode('utf-8'))

<mask token>
import requests
loc_url = 'http://ipinfo.io/loc'
WEATHER_URL = 'http://wttr.in/'
res = requests.get(loc_url)
loc = res.content.decode('utf-8').strip()
res = requests.get(WEATHER_URL + loc)
print(res.content.decode('utf-8'))

""" Using requests module to get the weather """
import requests

loc_url = "http://ipinfo.io/loc"
WEATHER_URL = "http://wttr.in/"

res = requests.get(loc_url)

# decode to unicode string and strip() to remove '\n' character
# print(res.content.decode("utf-8").strip())
loc = res.content.decode("utf-8").strip()

res = requests.get(WEATHER_URL + loc)

print(res.content.decode("utf-8"))
