-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
If there is a MUCH more popular book with a vaguely similar name, the much-more-popular book will be returned instead.
Incorrect:
goodreads book -a "the Art Of Invisibility"
Scott McCloud
Correct
./goodreads book -a "the Art Of Invisibility"
Kevin D. Mitnick
The solution is to wrap the book's name in quotes in the API call:
Rather than:
--author|-a )
curl -s -X "GET" --data "key=$DEVELOPER_KEY" --data "q=$3" "https://www.goodreads.com/search.xml" \
| grep "<name>.*" \
| sed "s/^[ \t]*//g" \
| sed "s/<[^>]*>//g" \
| awk 'NR==1 {print $0}'
use:
--author|-a )
curl -s -X "GET" --data "key=$DEVELOPER_KEY" --data "q=\"$3\"" "https://www.goodreads.com/search.xml" \
| grep "<name>.*" \
| sed "s/^[ \t]*//g" \
| sed "s/<[^>]*>//g" \
| awk 'NR==1 {print $0}'
where $3, the book's name string, is wrapped in \" quotes
Metadata
Metadata
Assignees
Labels
No labels