reformatted/tweaked and added the examples from example.py in the yelpapi package
[yelp-api-cdsw] / yelp2-json.py
diff --git a/yelp2-json.py b/yelp2-json.py
new file mode 100644 (file)
index 0000000..0d2d0c5
--- /dev/null
@@ -0,0 +1,16 @@
+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 bounding box and category. See
+# http://www.yelp.com/developers/documentation/v2/all_category_list
+# for an official list of Yelp categories. The bounding box definition
+# comes from
+# http://isithackday.com/geoplanet-explorer/index.php?woeid=12587707.
+
+# 5 bike rentals in San Francisco county
+
+response = yelp_api.search_query(category_filter='bikerentals', bounds='37.678799,-123.125740|37.832371,-122.356979', limit=5)
+
+print(response)

Benjamin Mako Hill || Want to submit a patch?