add lang in weather block
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
039bb2c2b1
commit
eb82aba33c
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue