Skip to content

Commit

Permalink
World news Locale fixes (#19)
Browse files Browse the repository at this point in the history
* Fix Gnews API request for locales

* Update VERSION
  • Loading branch information
garamb1 authored Apr 10, 2024
1 parent b4b2c00 commit 0061626
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7
0.7.1
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ private void updateNews() throws Exception {
.execute(
() -> {
for (Locale locale : locales) {
String language = locale.getLanguage().toLowerCase();
String country = locale.getCountry().toLowerCase();
try {
List<Article> articles =
apiClient.fetchNews(locale.getLanguage(), locale.getCountry()).articles();
List<Article> articles = apiClient.fetchNews(language, country).articles();
newArticles.put(locale.getDisplayCountry(), articles);
log.info("Fetched news for {}", locale);
Thread.sleep(settings.getRateLimiter());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ retrosearch.html.version=3.2
retrosearch.news.enable=${NEWS_ACTIVE:false}
retrosearch.news.api.key=${NEWS_API_KEY:}
retrosearch.news.api.rate.limiter=${NEWS_API_RATE_LIMITER:3000}
retrosearch.news.api.locales=${NEWS_API_LOCALES:en_US,en_UK,it_IT,de_DE}
retrosearch.news.api.locales=${NEWS_API_LOCALES:en_US,en_GB,it_IT,de_DE}

retrosearch.sports.football.enable=${FOOTBALL_API_ACTIVE:false}
retrosearch.sports.football.api.key=${FOOTBALL_API_KEY:}
Expand Down

0 comments on commit 0061626

Please sign in to comment.