diff --git a/src/add-ons/kernel/file_systems/googlefs/google_request.cpp b/src/add-ons/kernel/file_systems/googlefs/google_request.cpp index 0bae9ddd20..99dba0e8d2 100644 --- a/src/add-ons/kernel/file_systems/googlefs/google_request.cpp +++ b/src/add-ons/kernel/file_systems/googlefs/google_request.cpp @@ -27,14 +27,8 @@ using namespace BPrivate::Network; #define DO_PUBLISH //#define FAKE_INPUT "/boot/home/devel/drivers/googlefs/log2.html" -//#define TESTURL "http://www.google.com/search?as_q=google+api+&num=50&hl=en&ie=ISO-8859-1&btnG=Google+Search&as_epq=frequently+asked&as_oq=help&as_eq=plop&lr=lang_en&as_ft=i&as_filetype=&as_qdr=m3&as_nlo=&as_nhi=&as_occt=any&as_dt=i&as_sitesearch=" - -//#define BASEURL "http://www.google.com/search?as_q=" -//#define Q "google+api+" -//#define EXTRAURL "&num=50&hl=en&ie=ISO-8859-1&btnG=Google+Search&as_epq=frequently+asked&as_oq=help&as_eq=plop&lr=lang_en&as_ft=i&as_filetype=&as_qdr=m3&as_nlo=&as_nhi=&as_occt=any&as_dt=i&as_sitesearch=" - #define TESTURL "http://www.google.com/search?hl=en&ie=UTF-8&num=50&q=beos" -#define BASEURL "https://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&gws_rd=cr" +#define BASEURL "https://html.duckduckgo.com/html/?kd=-1" #define FMT_NUM "&num=%u" #define FMT_Q "&q=%s" diff --git a/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c b/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c index 314b294ccd..20cde3bfa2 100644 --- a/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c +++ b/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c @@ -31,20 +31,14 @@ int dbgstep = 0; #define PRST {} #endif -//old -//#define G_BEGIN_URL "

" +#define G_BEGIN_URL "" //#define G_BEGIN_NAME #define G_END_NAME "" -#define G_BEGIN_SNIPSET /*""*/"" -#define G_END_SNIPSET "
" +#define G_BEGIN_SNIPSET "" #define G_BEGIN_CACHESIM " " -#define G_URL_PREFIX "http://www.google.com" int google_parse_results(const char *html, size_t htmlsize, long *nextid, struct google_result **results) { @@ -62,16 +56,12 @@ int google_parse_results(const char *html, size_t htmlsize, long *nextid, struct /* sanity checks */ printf(DBG"sanity check...\n"); PRST; - /* google now sends sometimes... */ - if (strstr(html, "") != html) { - if (strstr(html, "") != html) { - if (strstr(html, "Google Search:"); - p = strstr(html, "Google"); + p = strstr(html, "DuckDuckGo"); if (!p) return EINVAL; PRST; p = strstr(html, "url; - if (!strncmp(item, "/url?", 5)) { - strcpy(urlp, G_URL_PREFIX); - itemlen -= strlen(G_URL_PREFIX); - urlp += strlen(G_URL_PREFIX); - printf("plop\n"); - } itemlen = MIN(itemlen, p - item - strlen(G_END_URL)); strncpy(urlp, item, itemlen); urlp[itemlen] = '\0';