summaryrefslogtreecommitdiffstats
path: root/ebknotify/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'ebknotify/cache.py')
-rw-r--r--ebknotify/cache.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/ebknotify/cache.py b/ebknotify/cache.py
index fbc4b9b..d1188dd 100644
--- a/ebknotify/cache.py
+++ b/ebknotify/cache.py
@@ -47,10 +47,16 @@ class Cache():
title = ad.get('title', {}).get('value', '').encode('utf-8')
title_unescaped = html_unescape(title)
try:
- img = ad['pictures']['picture'][0]['link'][4]['href']
+ img = ad['pictures']['picture'][0]['link'][3]['href']
except Exception as e:
- print(e)
img = None
+ try:
+ place = ad['locations']['location'][0]['localized-name']['value']
+ radius = ad['locations']['location'][0]['radius']['value']
+ except Exception as e:
+ print(e)
+ place = None
+ radius = None
# TODO: fetch detailed article
ad['notify'] = {
'filter': searchquery,
@@ -59,6 +65,8 @@ class Cache():
'first-seen': now.isoformat(),
'title-unescaped': title_unescaped,
'age_in_h': age_in_h,
+ 'place': place,
+ 'radius': radius,
'price': price,
'image': img,
'url': ad['link'][1]['href'],