Comment¶
GoodreadsComment¶
GoodreadsComment is a BetterReads object for interfacing with comment data from Goodreads.
Properties¶
- gid: Goodreads id of the comment (type: int)
- body: Text body of the comment (type: string)
- user: GoodreadsUser that authored the comment (type: GoodreadsUser)
- created_at: String representation of the date when the comment was created (type: datetime)
- updated_at: String representation of the date when the comment was updated (type: datetime)
Usage¶
You can query Comments on a resource from the GoodreadsClient by searching by id.
>>> from betterreads.client import GoodreadsClient
>>> gc = GoodreadsClient('GOODREADS_API_KEY', 'GOODREADS_SECRET')
>>> comments = gc.list_comments("review", 123456)
>>> comment = comments[0]
>>> comment.body
u'This was a really good review'
When querying for a comment, you must specify which type of resource you’re grabbing comments for. Valid resource types are:
author_blog_postblogbook_news_postchaptercommentcommunity_answerevent_responsefanshipfriendgiveawaygiveaway_requestgroup_userinterviewlibrarian_notelink_collectionlistowned_bookphotopollpoll_votequeued_itemquestionquestion_user_statquizquiz_scoreratingread_statusrecommendationrecommendation_requestreviewtopicuseruser_challengeuser_followinguser_list_challengeuser_list_voteuser_quoteuser_statusvideo