diff options
author | Joe Robinson <joe@mumsnet.com> | 2014-09-23 17:45:24 +0100 |
---|---|---|
committer | Joe Robinson <joe@mumsnet.com> | 2014-09-23 17:45:24 +0100 |
commit | 2c5652f1d098aa5b7590ee1bda13b9968d27258a (patch) | |
tree | 0eb84d90fc22e00dce3abdd905daf79a5938f66a /bladictionary.py | |
parent | 9b9606137f48284aae9918b04769d7485d417239 (diff) |
Fix multi word definitions for urban dictionary
Diffstat (limited to 'bladictionary.py')
-rwxr-xr-x | bladictionary.py | 4 |
1 files changed, 3 insertions, 1 deletions
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) |