From fd8882d1a88896f64bb5363b4f9a407b1cab6f12 Mon Sep 17 00:00:00 2001 From: Pimverleg Date: Mon, 8 Nov 2021 14:20:40 +0100 Subject: [PATCH] Update instagram-locations.py In my opinion, this code is a little bit more clear. --- instagram-locations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instagram-locations.py b/instagram-locations.py index bd0bcd3..2b47f45 100644 --- a/instagram-locations.py +++ b/instagram-locations.py @@ -41,17 +41,17 @@ def get_fuzzy_locations(lat, lng, cookie, sigma=2): return locs # converts list of instagram locations into valid geojson -def make_geojson(locs): +def make_geojson(locations): features = [] - for l in [l for l in locs if 'lng' in l]: + for location in [location for location in locations if 'lng' in location]: feature = { "type": "Feature", "geometry": { "type": "Point", - "coordinates": [l["lng"], l["lat"]] + "coordinates": [location["lng"], location["lat"]] }, - "properties": l} + "properties": location} features.append(feature) return {"type": "FeatureCollection", "features": features}