summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--getabook.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/getabook.c b/getabook.c
index ac88f6d..1ac09cb 100644
--- a/getabook.c
+++ b/getabook.c
@@ -68,6 +68,13 @@ int getpagelist()
if(!get("www.amazon.com", url, NULL, NULL, &buf))
return 1;
+ /* amazon have a canonical asin, which is needed to get all available pages */
+ if((s = strstr(buf, "\"ASIN\":\"")) != NULL) {
+ s+=strlen("\"ASIN\":\"");
+ strncpy(bookid, s, 10);
+ bookid[10] = '\0';
+ }
+
if((s = strstr(buf, "\"litbPages\":[")) == NULL)
return 1;
s+=strlen("\"litbPages\":[");