diff --git a/geo.c b/geo.c index 67590dc..0db69c4 100644 --- a/geo.c +++ b/geo.c @@ -3,11 +3,10 @@ #include #include #include "utstring.h" +#include "config.h" #include "geo.h" #include "json.h" -#define GURL "http://maps.googleapis.com/maps/api/geocode/json?latlng=%lf,%lf&sensor=false&language=EN" - static CURL *curl; static size_t writemem(void *contents, size_t size, size_t nmemb, void *userp) @@ -57,8 +56,8 @@ static int goog_decode(UT_string *geodata, UT_string *addr, UT_string *cc) // printf("%s\n", utstring_body(geodata)); if ((j = json_find_member(json, "status")) != NULL) { // printf("}}}}}} %s\n", j->string_); - if (strcmp(j->string_, "OVER_QUERY_LIMIT") == 0) { - fprintf(stderr, "revgeo: %s\n", j->string_); + if (strcmp(j->string_, "OK") != 0) { + fprintf(stderr, "revgeo: %s (%s)\n", j->string_, utstring_body(geodata)); return (0); } }