Loading plugins/google/google.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ namespace blogi { try { getConfig(*Args->database[0], "GOOGLE_PLACE_ID", _placeId); } catch(...) {} try { getConfig(*Args->database[0], "GOOGLE_REVIEW_NOTIFY_EMAIL", _notifyEmail); } catch(...) {} try { getConfig(*Args->database[0], "GOOGLE_REVIEW_SYNC_DAYS", _syncDays); } catch(...) {} try { getConfig(*Args->database[0], "GOOGLE_REVIEW_LANGUAGE", _language); } catch(...) {} _syncThread = std::thread(&GooglePlugin::_syncWorker, this); Loading Loading @@ -124,6 +125,10 @@ namespace blogi { _placeId = cur.value; setConfig(*Args->database[tid], "GOOGLE_PLACE_ID", cur.value); saved = true; } else if(cur.key == "google_language") { _language = cur.value; setConfig(*Args->database[tid], "GOOGLE_REVIEW_LANGUAGE", cur.value); saved = true; } } Loading Loading @@ -176,6 +181,7 @@ namespace blogi { addTextField("google_api_key", "Google Places API Key", _apiKey); addTextField("google_place_id", "Google Place ID", _placeId); addTextField("google_language", "Sprache (z.B. de, en)", _language); addTextField("google_notify_email", "Notification E-Mail", _notifyEmail); addTextField("google_sync_days", "Sync Interval (days)", std::to_string(_syncDays), "number"); Loading Loading @@ -319,6 +325,7 @@ namespace blogi { std::string _apiKey; std::string _placeId; std::string _notifyEmail; std::string _language = "de"; int _syncDays = 1; void _syncWorker() { Loading @@ -338,7 +345,8 @@ namespace blogi { void _fetchFromGoogle(int tid) { try { std::string path = "/maps/api/place/details/json?place_id=" + _placeId + "&fields=reviews%2Creviews.profile_photo_url&key=" + _apiKey; + "&fields=reviews%2Creviews.profile_photo_url&language=" + _language + "&key=" + _apiKey; libhttppp::HttpUrl apiUrl("https://maps.googleapis.com" + path); libhttppp::HttpClient client(apiUrl); client.setTimeout(15); Loading Loading
plugins/google/google.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ namespace blogi { try { getConfig(*Args->database[0], "GOOGLE_PLACE_ID", _placeId); } catch(...) {} try { getConfig(*Args->database[0], "GOOGLE_REVIEW_NOTIFY_EMAIL", _notifyEmail); } catch(...) {} try { getConfig(*Args->database[0], "GOOGLE_REVIEW_SYNC_DAYS", _syncDays); } catch(...) {} try { getConfig(*Args->database[0], "GOOGLE_REVIEW_LANGUAGE", _language); } catch(...) {} _syncThread = std::thread(&GooglePlugin::_syncWorker, this); Loading Loading @@ -124,6 +125,10 @@ namespace blogi { _placeId = cur.value; setConfig(*Args->database[tid], "GOOGLE_PLACE_ID", cur.value); saved = true; } else if(cur.key == "google_language") { _language = cur.value; setConfig(*Args->database[tid], "GOOGLE_REVIEW_LANGUAGE", cur.value); saved = true; } } Loading Loading @@ -176,6 +181,7 @@ namespace blogi { addTextField("google_api_key", "Google Places API Key", _apiKey); addTextField("google_place_id", "Google Place ID", _placeId); addTextField("google_language", "Sprache (z.B. de, en)", _language); addTextField("google_notify_email", "Notification E-Mail", _notifyEmail); addTextField("google_sync_days", "Sync Interval (days)", std::to_string(_syncDays), "number"); Loading Loading @@ -319,6 +325,7 @@ namespace blogi { std::string _apiKey; std::string _placeId; std::string _notifyEmail; std::string _language = "de"; int _syncDays = 1; void _syncWorker() { Loading @@ -338,7 +345,8 @@ namespace blogi { void _fetchFromGoogle(int tid) { try { std::string path = "/maps/api/place/details/json?place_id=" + _placeId + "&fields=reviews%2Creviews.profile_photo_url&key=" + _apiKey; + "&fields=reviews%2Creviews.profile_photo_url&language=" + _language + "&key=" + _apiKey; libhttppp::HttpUrl apiUrl("https://maps.googleapis.com" + path); libhttppp::HttpClient client(apiUrl); client.setTimeout(15); Loading