Goodreads Developers discussion

26 views
questions > review.list returns 200 (no error) but no

Comments Showing 1-4 of 4 (4 new)    post a comment »
dateUp arrow    newest »

message 1: by Mohan (new)

Mohan (mohansn) | 5 comments My plan is:
1. Get a list of books on my shelf (using review.list)
2. For each book, find popular shelves it is found on. (popular_shelves tag in book.show response).
3. Generate a word cloud of these shelves (or some other visualization).

I am stuck in step 1.
My attempt is at http://dabblinginanalytics.appspot.com/ . Click on 'What do I read?'

I get a 200 OK response, but no data.
I am probably missing out on something basic.


message 2: by Nichole (new)

Nichole Treadway Hey Mohan,

Can you post the request you're sending for step 1 (with all the secret things such as oauth keys removed of course) ? What language are you using? Are you able to get other GR api requests to work, just not review.list ?


message 3: by Mohan (new)

Mohan (mohansn) | 5 comments How do I find this?
From Chrome's web inspector (Network):
http://dabblinginanalytics.appspot.co...

In my code I do this:

def get_reviews (session):
if (session is None):
return 'Not a valid session'
uid, uname = get_user (session)
param = {}
param ['format'] = 'xml'
param ['v'] = 2
param ['id'] = uid
param ['sort'] = 'date_added'
param ['per_page'] = 100
param ['page'] = 1
result = session.get ('https://www.goodreads.com/review/list/' + str(param['id']), params=param)
return str(result)

which is invoked from:
class Get_Reviews (webapp2.RequestHandler):
def get (self):
session = OAuth1Session(
consumer_key = CONSUMER_KEY,
consumer_secret = CONSUMER_SECRET,
access_token = self.request.cookies.get('access_token'),
access_token_secret = self.request.cookies.get('access_token_secret')
)
self.response.write (get_reviews (session))


message 4: by Ettore (last edited May 26, 2015 05:55PM) (new)

Ettore Pasquini hey Mohan, are all your api calls going through the same initialization code (that sets up OAuth, etc) ? Just wondering if we can rule out some errors in special handling code (if it exists) for this api call.

Other things to look out for (sorry if these are obvious):
- did you verify that the variable "uid" holds the correct user if you're trying to access? (i.e. does get_user() have bugs)
- does the user you're trying to read the shelves of have protected data maybe?
- you shouldn't need to repeat the "id" as part of the url and as a param. I would just pass it as a param, so get("http://ww.goodreads.com/review/list", params=param) since you're including the id in the params list.
- also verify the access token and access_token_secret (likely they are ok since the api is returning a 200, but still worth checking that they are the same as other api calls.)


back to top