summaryrefslogtreecommitdiff
path: root/getabook.c
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-09-29 19:13:27 +0100
committerNick White <git@njw.me.uk>2011-09-29 19:13:27 +0100
commit399438e4a78777db9230968ef5902915b4c814ce (patch)
treeda8fd7f49970b3afd3afb5a7f5a07bef3eb4856b /getabook.c
parenta8400b4837f67b2e0ab7fbf5bdd12545c9bac390 (diff)
Post to goToPage amazon url; more reliable for some reason
Diffstat (limited to 'getabook.c')
-rw-r--r--getabook.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/getabook.c b/getabook.c
index 03552a7..ac88f6d 100644
--- a/getabook.c
+++ b/getabook.c
@@ -91,11 +91,13 @@ int getpagelist()
int getpageurls(int pagenum) {
char url[URLMAX];
+ char query[URLMAX];
char *buf = NULL;
- snprintf(url, URLMAX, "/gp/search-inside/service-data?method=goToPage&asin=%s&page=%d", bookid, pagenum);
+ strncpy(url, "/gp/search-inside/service-data", URLMAX);
+ snprintf(query, URLMAX, "method=goToPage&asin=%s&page=%d", bookid, pagenum);
- if(!get("www.amazon.com", url, NULL, NULL, &buf))
+ if(!post("www.amazon.com", url, query, &buf))
return 1;
fillurls(buf);