Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@ An important thing to note is that JSON has objects and lists. If you see `{}` t
```
result["type"]
```
This would result in `Feature`.
This would result in `FeatureCollection`.

But if you see `[]` somewhere that means you can't just access it straight away but you have to *loop* over the included elements.
So if we want to print all the names of the hotspots we need to do this:
```python
for features in result["features"]
for features in result["features"]:
print features["properties"]["NAME"]
```
The result here would be `Wiener Linien WLAN`... 10 times... because that's how they roll! They named all their WLANs the same way :D
Expand All @@ -270,7 +270,7 @@ if "message" in messaging_event:

# Iterate through each entry in the results
for entry in result["features"]:
entry = create_generic_template_element(feature["properties"]["NAME"], "http://blog.wienerlinien.at/wp-content/uploads/2016/04/header_wifi.jpg", entry["properties"]["ADRESSE"])
entry = create_generic_template_element(entry["properties"]["NAME"], "http://blog.wienerlinien.at/wp-content/uploads/2016/04/header_wifi.jpg", entry["properties"]["ADRESSE"])

# Add each wifi router to the list we've created above
entries.append(entry)
Expand Down