diff options
author | makefu <github@syntax-fehler.de> | 2020-04-01 11:02:52 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2020-04-01 11:02:52 +0200 |
commit | d16ce227dc68c9f60f6dd06e6835bab7cdfdf61b (patch) | |
tree | 6a84a164748f01f09253f7fe09fbf681cd06f00c | |
parent | ea15361b1e4e77361b54abff3493658eae7f97e2 (diff) |
-rw-r--r-- | ebknotify/cache.py | 6 | ||||
-rw-r--r-- | ebknotify/feed.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ebknotify/cache.py b/ebknotify/cache.py index d1188dd..faa5fbf 100644 --- a/ebknotify/cache.py +++ b/ebknotify/cache.py @@ -52,11 +52,11 @@ class Cache(): img = None try: place = ad['locations']['location'][0]['localized-name']['value'] - radius = ad['locations']['location'][0]['radius']['value'] + distance = round(float(ad['search-distance']['distance']['value']),2) except Exception as e: print(e) place = None - radius = None + distance = None # TODO: fetch detailed article ad['notify'] = { 'filter': searchquery, @@ -66,7 +66,7 @@ class Cache(): 'title-unescaped': title_unescaped, 'age_in_h': age_in_h, 'place': place, - 'radius': radius, + 'distance': distance, 'price': price, 'image': img, 'url': ad['link'][1]['href'], diff --git a/ebknotify/feed.py b/ebknotify/feed.py index 8d267a5..98d88a2 100644 --- a/ebknotify/feed.py +++ b/ebknotify/feed.py @@ -27,7 +27,7 @@ class Feed(FeedGenerator): </a> <ul> <li>Created: {item['notify']['creation'].split("+")[0]}</li> - <li>Place: {item['notify']['place']} ({item['notify']['radius']} km)</li> + <li>Place: {item['notify']['place']} ({item['notify']['distance']} km)</li> <li>Filter: {item['notify']['filter-name']}</li> </ul> <div> |