Skip to content
This repository has been archived by the owner on Apr 28, 2018. It is now read-only.

Commit

Permalink
Issue #25: Refactor yelp resolution so can do with key (not just url).
Browse files Browse the repository at this point in the history
  • Loading branch information
mcomella authored and liuche committed Feb 1, 2017
1 parent 3c44897 commit 4b60054
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/providers/yelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

idPattern = re.compile("/([^/\?]*)(\?.*)?$")


def resolve_with_key(key):
key = key.encode('utf-8').strip()
return yelp3Client.request("/businesses/{0}".format(key))


def resolve(idObj):
key = slug(idObj["url"])
key = key.encode('utf-8').strip()
return yelp3Client.request("/businesses/{0}".format(key))
return resolve_with_key(key)

0 comments on commit 4b60054

Please sign in to comment.