From 46c174be8da6a154e3c8514c1a65fc3120c2fca1 Mon Sep 17 00:00:00 2001 From: ganome Date: Thu, 4 Dec 2025 18:37:33 -0700 Subject: [PATCH] Added README --- README | 1 + include/scraper.h | 2 +- src/scraper.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..5059c50 --- /dev/null +++ b/README @@ -0,0 +1 @@ +This project was written ENTIRELY with AI diff --git a/include/scraper.h b/include/scraper.h index 88d23be..1246e0c 100644 --- a/include/scraper.h +++ b/include/scraper.h @@ -28,6 +28,6 @@ char *extract_h1(const char *html, size_t len); * Returns 0 and allocates *out on success (caller frees), or -1. * Each line represents one product; fields are separated by '|'. */ -int extract_products(const char *html, size_t len, char **out); +int extract_products(const char *html, size_t len, const char *base_url, char **out); #endif /* SCRAPER_H */ diff --git a/src/scraper.c b/src/scraper.c index a8511bc..15590ed 100644 --- a/src/scraper.c +++ b/src/scraper.c @@ -390,7 +390,7 @@ static char *find_price_in_node(xmlNode *node) { if (xmlStrcasecmp(cur->name, (const xmlChar *)"a") != 0 && xmlStrcasecmp(cur->name, (const xmlChar *)"h1") != 0 && xmlStrcasecmp(cur->name, (const xmlChar *)"h2") != 0 && - (strchr(txt, '$') || strchr(txt, '£') || strchr(txt, '€') || strstr(txt, "USD") || strstr(txt, "EUR"))) { + (strchr(txt, '$') || strstr(txt, "£") || strstr(txt, "€") || strstr(txt, "USD") || strstr(txt, "EUR"))) { if (strlen(txt) < 200) { char *trim = strdup(txt); free(txt);