diff options
author | Nick White <git@njw.me.uk> | 2011-09-29 19:25:13 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2011-09-29 19:25:13 +0100 |
commit | 6d992fbe0ee99dda0ec450d9d3f8941118414d37 (patch) | |
tree | 2542dfad64413716040cd0f13de2b4d0ce955727 | |
parent | 399438e4a78777db9230968ef5902915b4c814ce (diff) |
Use canonical asin for any amazon book
-rw-r--r-- | getabook.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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\":["); |