Added README

This commit is contained in:
ganome 2025-12-04 18:37:33 -07:00
parent 2afe840ede
commit 46c174be8d
Signed by untrusted user who does not match committer: Ganome
GPG Key ID: 944DE53336D81B83
3 changed files with 3 additions and 2 deletions

1
README Normal file
View File

@ -0,0 +1 @@
This project was written ENTIRELY with AI

View File

@ -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 */

View File

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