X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/812909d1812d7f659f21963eda01078b57e05430..020b155be89ee1825309eb6d8d1958f3b46c310d:/src/googlesearch.c?ds=sidebyside diff --git a/src/googlesearch.c b/src/googlesearch.c index f8c58cf6..8037663c 100644 --- a/src/googlesearch.c +++ b/src/googlesearch.c @@ -27,13 +27,15 @@ #include "curl_download.h" #define GOOGLE_SEARCH_URL_FMT "http://maps.google.com/maps?q=%s&output=js" -#define GOOGLE_SEARCH_PATTERN_1 "{center: {lat: " -#define GOOGLE_SEARCH_PATTERN_2 ",lng: " +#define GOOGLE_SEARCH_PATTERN_1 "{center:{lat:" +#define GOOGLE_SEARCH_PATTERN_2 ",lng:" static gchar *last_search_str = NULL; static VikCoord *last_coord = NULL; static gchar *last_successful_search_str = NULL; +static DownloadOptions googlesearch_options = { 0, "http://maps.google.com/" }; + gchar * a_googlesearch_get_search_string_for_this_place(VikWindow *vw) { if (!last_coord) @@ -206,7 +208,7 @@ static int google_search_get_coord(VikWindow *vw, VikViewport *vvp, gchar *srch_ uri = g_strdup_printf(GOOGLE_SEARCH_URL_FMT, escaped_srch_str); /* TODO: curl may not be available */ - if (curl_download_uri(uri, tmp_file)) { /* error */ + if (curl_download_uri(uri, tmp_file, &googlesearch_options)) { /* error */ fprintf(stderr, "DEBUG: %s() download error\n", __PRETTY_FUNCTION__); fclose(tmp_file); ret = -1;