summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-04-01 11:02:52 +0200
committermakefu <github@syntax-fehler.de>2020-04-01 11:02:52 +0200
commitd16ce227dc68c9f60f6dd06e6835bab7cdfdf61b (patch)
tree6a84a164748f01f09253f7fe09fbf681cd06f00c
parentea15361b1e4e77361b54abff3493658eae7f97e2 (diff)
use distance instead of radiusHEADmaster
-rw-r--r--ebknotify/cache.py6
-rw-r--r--ebknotify/feed.py2
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>
[cgit] Unable to lock slot /tmp/cgit/f9200000.lock: No such file or directory (2)