Skip to content

Commit e11bb55

Browse files
committed
Adds a message about the changed but still working URLs on wunderground.com
1 parent 0ee8325 commit e11bb55

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

apps/05_weather_client/you_try/README.md

+26-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ The WHITE text is output from the program. The YELLOW input is what the users ty
88

99
This application will ask the user for their zip code. Then you will use this zip code, the requests and beautiful soup 4 PyPI packages to download a weather web page, scrape out the relevant info and display it back on the console.
1010

11+
Note: If you visit [wunderground.com](https://www.wunderground.com) today and search for a location, it no longer uses the zipcode as clearly in the URL. For example, my local report is [wunderground.com/weather/us/or/portland](https://www.wunderground.com/weather/us/or/portland). However, the URL in the code and demos still works entirely well. It's just not publicly used on the site. For example, this URL is fine:
12+
13+
[http://www.wunderground.com/weather-forecast/92018](http://www.wunderground.com/weather-forecast/92018)
14+
1115
Key concepts introduced
1216
=================
1317

@@ -31,12 +35,31 @@ Quick start: [http://www.crummy.com/software/BeautifulSoup/bs4/doc/#quick-start]
3135
**tuples**
3236

3337
# Create a tuple
34-
m = (22.5, 44.234, 19.02, 'strong') temp = m[0] # 22.5 quality = m[3] # 'strong' print(m) # (22.5, 44.234, 19.02, 'strong') # tuple unpacking t, la, lo, q = m
38+
m = (22.5, 44.234, 19.02, 'strong')
39+
40+
temp = m[0] # 22.5
41+
quality = m[3] # 'strong'
42+
43+
print(m) # (22.5, 44.234, 19.02, 'strong')
44+
45+
# tuple unpacking
46+
t, la, lo, q = m
3547

3648
**namedtuples**
3749

3850
import collections
3951

4052
# Define a named tuple 'type'
41-
Measurement = collections.namedtuple('Measurement', 'temp, lat, long, quality') # Create an instance of that type of named tuple m = Measurement(22.5, 44.234, 19.02, 'strong') temp = m[0] # old skool temp = m.temp # new hotness quality = m.quality # new hotness print(m) # Measurement(temp=22.5, lat=44.234,
42-
long=19.02, quality='strong')
53+
Measurement = collections.namedtuple('Measurement',
54+
'temp, lat, long, quality')
55+
56+
# Create an instance of that type of named tuple
57+
m = Measurement(22.5, 44.234, 19.02, 'strong')
58+
59+
temp = m[0] # old skool
60+
temp = m.temp # new hotness
61+
quality = m.quality # new hotness
62+
63+
print(m)
64+
# Measurement(temp=22.5, lat=44.234,
65+
long=19.02, quality='strong')

0 commit comments

Comments
 (0)