diff options
-rwxr-xr-x | coupons.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -196,7 +196,16 @@ def parse_coupons(inputobject, searchstring = None): rcat = c["name"] #response[rgroup][rcat] = [] for i in c["items"]: - text = i["html"] + print(f"item = {i}") + try: + text = i["html"] + except: + text = i["name"] + add_text = "" + for h in i["items"] if "items" in i else []: + add_text += "<li>" + str(h["html"] if "html" in h else "") + str(h["notes"] if "notes" in h else "") + "</li>" + if "" != add_text: + text += "<ul>" + add_text + "</ul>" if "notes" in i and i["notes"] != "": text = text + " <small>" + i["notes"] + "</small>" #if searchstring in text.lower(): |