Matt Matt’s Comments (group member since May 02, 2018)


Matt’s comments from the Goodreads Developers group.

Showing 1-6 of 6

Feb 22, 2021 04:05AM

8095 The only feature "improvement" I can remember on Android is when they changed the barcode scanner works so you have to manually shelve (very slowly!) each book individually, rather than being able to do them all at the time. But hey, at least they did *something* to it, which is more than can be said for the rest of the site!
8095

#!/usr/bin/python3

import re
from xml.etree import ElementTree

import requests


USER_ID = 10_052_745
API_KEY = "[% REDACTED %]"

r = requests.get(f"https://www.goodreads.com/review/list...", params={
"key": API_KEY,
"v": 2,
"per_page": 10,
"page": 1
})
x = ElementTree.fromstring(r.content)

for r in x.findall("reviews/"):
print("title:", r.find("book/title_without_series").text)
print("exclusive shelf:", r.find("shelves/shelf[@exclusive='true']").get("name"))
print("all shelves:")
for shelf in r.findall("shelves/"):
shelf_name = shelf.get("name")
shelf_id = shelf.get("id")
print(f"* {shelf_name} ({shelf_id})")

print()

# vim: ts=4 : sw=4 : et


that'll produce something like this:


title: Nightblind
exclusive shelf: library
all shelves:
* library (264428736)
* borrowed (219480356)

title: Island
exclusive shelf: to-read
all shelves:
* to-read (33356208)

Jun 08, 2018 09:40AM

8095 yeah, unfortunately the API's features include pretty major limitations and certain......infelicities :-/

for my own use i've been manually copying/pasting the dates out of the web interface, though obviously that's not particularly scalable.
8095 any idea if/when this might be making an appearance. it would be an extremely useful feature!
May 22, 2018 03:10AM

8095 i've not come across any cases where they're missing altogether, but i have noticed that <{started,read}_at> are set to the point when you moved the book onto the currently-reading and read shelves, not the started/finished dates you fill in when you submit the review¹.

is this a book you added straight to your Read shelf?

_
¹ there doesn't appear to be any way of getting the latter through the API.
8095 For some books, the edition language is correct in the web interface, but the language_code element in the API results for that book is unset.

An example: https://www.goodreads.com/book/show/5... shows an Edition Language of English. However,

"""
gr_key=[% key %]

get_gr_book() {
book_id=$1
gr_xml=$(curl -s https://www.goodreads.com/book/show/$...)
echo -n 'Author: '; echo "$gr_xml" | xml_grep --text_only //GoodreadsResponse/book/authors/author[0]/name
echo -n 'Title: '; echo "$gr_xml" | xml_grep --text_only //GoodreadsResponse/book/title
echo -n 'Language: '; echo "$gr_xml" | xml_grep --text_only //GoodreadsResponse/book/language_code
echo
}

$ get_gr_book 5968469
Author: Agnes Owens
Title: The Complete Short Stories
Language:

$
"""

This does, however, work with other books:

"""
$ get_gr_book 366649
Author: Émile Zola
Title: Le Ventre de Paris (Les Rougon-Macquart, #3)
Language: fre

$
"""