reformatted/tweaked and added the examples from example.py in the yelpapi package
[yelp-api-cdsw] / yelp1-json.py
diff --git a/yelp1-json.py b/yelp1-json.py
new file mode 100644 (file)
index 0000000..88f370c
--- /dev/null
@@ -0,0 +1,14 @@
+from yelpapi import YelpAPI
+from yelp_authentication import CONSUMER_KEY, CONSUMER_SECRET, TOKEN, TOKEN_SECRET
+
+yelp_api = YelpAPI(CONSUMER_KEY, CONSUMER_SECRET, TOKEN, TOKEN_SECRET)
+
+# Example search by location text and term. Take a look at
+# http://www.yelp.com/developers/documentation/v2/search_api for
+# the various options available.
+
+# print the 5 best rated ice cream places in Austin, TX
+
+response = yelp_api.search_query(term='ice cream', location='austin, tx', sort=2, limit=5)
+
+print(response)

Benjamin Mako Hill || Want to submit a patch?