reformatted/tweaked and added the examples from example.py in the yelpapi package
[yelp-api-cdsw] / yelp3.py
diff --git a/yelp3.py b/yelp3.py
new file mode 100644 (file)
index 0000000..51dbcde
--- /dev/null
+++ b/yelp3.py
@@ -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 business query. Look at
+# http://www.yelp.com/developers/documentation/v2/business for more
+# information.
+
+print("***** selected reviews for Amy's on 6th St. *****")
+
+business = yelp_api.business_query(id='amys-ice-creams-austin-3')
+
+for review in business['reviews']:
+    print('rating: %d\nexcerpt: %s\n' % (review['rating'], review['excerpt']))
+

Benjamin Mako Hill || Want to submit a patch?