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);