Skip to content

Commit

Permalink
Fix minor bug with slash (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
jandeschuttere authored Dec 20, 2024
1 parent 8e31b50 commit b78e31b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion onecall.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (w *OneCallData) OneCallByCoordinates(location *Coordinates) error {
// OneCallTimeMachine will provide the onecall timemachine weather with the
// provided location coordinates and unix timestamp
func (w *OneCallData) OneCallTimeMachine(location *Coordinates, datetime time.Time) error {
response, err := w.client.Get(fmt.Sprintf(fmt.Sprintf(onecallURL, "timemachine?appid=%s&lat=%f&lon=%f&units=%s&lang=%s&dt=%d"), w.Key, location.Latitude, location.Longitude, w.Unit, w.Lang, datetime.Unix()))
response, err := w.client.Get(fmt.Sprintf(fmt.Sprintf(onecallURL, "/timemachine?appid=%s&lat=%f&lon=%f&units=%s&lang=%s&dt=%d"), w.Key, location.Latitude, location.Longitude, w.Unit, w.Lang, datetime.Unix()))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion openweathermap.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (
var DataUnits = map[string]string{"C": "metric", "F": "imperial", "K": "internal"}
var (
baseURL = "https://api.openweathermap.org/data/2.5/weather?%s"
onecallURL = "https://api.openweathermap.org/data/3.0/onecall/%s"
onecallURL = "https://api.openweathermap.org/data/3.0/onecall%s"
iconURL = "https://openweathermap.org/img/w/%s"
groupURL = "http://api.openweathermap.org/data/2.5/group?%s"
stationURL = "https://api.openweathermap.org/data/2.5/station?id=%d"
Expand Down

0 comments on commit b78e31b

Please sign in to comment.