From 2c5652f1d098aa5b7590ee1bda13b9968d27258a Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Tue, 23 Sep 2014 17:45:24 +0100 Subject: Fix multi word definitions for urban dictionary --- bladictionary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bladictionary.py b/bladictionary.py index c3ee7db..5e87b71 100755 --- a/bladictionary.py +++ b/bladictionary.py @@ -426,6 +426,9 @@ def parse_foldoc(word, refer = None): return items def parse_urban(word): + + word = word.replace(" ", "+") + try: r = requests.get("http://urbanscraper.herokuapp.com/search/" + word) json = r.json() @@ -436,7 +439,6 @@ def parse_urban(word): items = [] id = 1 for json_item in json: - print json_item if json_item['definition'] != "" and json_item['definition'] is not None: item = Definition(word, id, "urban", "urban", json_item['definition'], [json_item['example']], [], []) items.append(item) -- cgit v1.2.3