diff options
author | clarkzjw <[email protected]> | 2023-02-22 23:57:11 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-23 12:07:32 -0800 |
commit | 5402e3a2e9df24a883e2e20dfae6c92f11b8d499 (patch) | |
tree | 0337ca914685d2f52fbe34bf3fb7be89d7aa9721 /foursquare | |
parent | 736ba02520802499c9970afd9d1ee6a537fb2230 (diff) | |
download | swarm2fediverse-5402e3a2e9df24a883e2e20dfae6c92f11b8d499.tar.gz |
bot: change create_poi to create_or_update_poi
Diffstat (limited to 'foursquare')
-rw-r--r-- | foursquare/poi.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/foursquare/poi.py b/foursquare/poi.py index 4ff11fb..ea3509f 100644 --- a/foursquare/poi.py +++ b/foursquare/poi.py | |||
@@ -3,7 +3,7 @@ import json | |||
3 | import requests | 3 | import requests |
4 | 4 | ||
5 | from config import FSQ_API_KEY | 5 | from config import FSQ_API_KEY |
6 | from dbstore.peewee_store import create_poi | 6 | from dbstore.peewee_store import create_or_update_poi |
7 | 7 | ||
8 | POI_API_ENDPOINT = "https://api.foursquare.com/v3/places/nearby?ll={}%2C{}&limit=10" | 8 | POI_API_ENDPOINT = "https://api.foursquare.com/v3/places/nearby?ll={}%2C{}&limit=10" |
9 | POI_SEARCH_API_ENDPOINT = "https://api.foursquare.com/v3/places/search?query={}&ll={}%2C{}&radius=2000&limit=10" | 9 | POI_SEARCH_API_ENDPOINT = "https://api.foursquare.com/v3/places/search?query={}&ll={}%2C{}&radius=2000&limit=10" |
@@ -32,7 +32,7 @@ def query_poi(search, latitude, longitude): | |||
32 | "osm_url": OSM_ENDPOINT.format(poi["geocodes"]["main"]["latitude"], poi["geocodes"]["main"]["longitude"]) | 32 | "osm_url": OSM_ENDPOINT.format(poi["geocodes"]["main"]["latitude"], poi["geocodes"]["main"]["longitude"]) |
33 | } | 33 | } |
34 | locations.append(loc) | 34 | locations.append(loc) |
35 | create_poi(loc) | 35 | create_or_update_poi(loc) |
36 | 36 | ||
37 | return locations | 37 | return locations |
38 | 38 | ||