diff --git a/README.md b/README.md index 228cd20..1cad96b 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Show the weather of the given location ([https://fr.wttr.in/](https://fr.wttr.in ``` [weather] -command=/path/to/weather -loc=Paris +command=/path/to/weather -loc=Paris -lang=fr format=json markup=pango interval=1800 diff --git a/blocks/weather/main.go b/blocks/weather/main.go index 1f30dc8..0784079 100644 --- a/blocks/weather/main.go +++ b/blocks/weather/main.go @@ -22,13 +22,15 @@ func main() { var wg sync.WaitGroup argLocation := flag.String("loc", "", "location") + argLang := flag.String("lang", "fr", "lang") flag.Parse() - url := fmt.Sprintf("https://fr.wttr.in/%s?format=%%l+%%c+%%t+%%m", *argLocation) + url := fmt.Sprintf("https://%s.wttr.in/%s?format=%%l+%%c+%%t+%%m", *argLang, *argLocation) if os.Getenv("BLOCK_BUTTON") == "1" { + url2 := fmt.Sprintf("https://%s.wttr.in/%s", *argLang, *argLocation) wg.Add(1) - go openBrowser(&wg, url) + go openBrowser(&wg, url2) } resp, err := http.Get(url)