From 5324ec76cfe594a471ea728822a444508960f2f1 Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Wed, 2 Jan 2019 00:41:11 -0500 Subject: [PATCH] Get weather over https --- src/app/weather/weather.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/weather/weather.service.ts b/src/app/weather/weather.service.ts index e375eae..08c97b8 100644 --- a/src/app/weather/weather.service.ts +++ b/src/app/weather/weather.service.ts @@ -24,7 +24,7 @@ export class WeatherService { } async search(text: string) { - this.locationKey = (await this.http.get(`http://dataservice.accuweather.com/locations/v1/search?apikey=${environment.accuWeather}&q=${text}`).toPromise())[0].Key; + this.locationKey = (await this.http.get(`https://dataservice.accuweather.com/locations/v1/search?apikey=${environment.accuWeather}&q=${text}`).toPromise())[0].Key; this.update(); } @@ -35,7 +35,7 @@ export class WeatherService { } this.sub = timer(0, 60000).subscribe(async () => { - let temp: any = await this.http.get(`http://dataservice.accuweather.com/forecasts/v1/daily/5day/${this.locationKey}?apikey=${environment.accuWeather}&metric=${this.metric}&details=true`).toPromise(); + let temp: any = await this.http.get(`https://dataservice.accuweather.com/forecasts/v1/daily/5day/${this.locationKey}?apikey=${environment.accuWeather}&metric=${this.metric}&details=true`).toPromise(); this.weather = temp['DailyForecasts'].map(forecast => ({ cloudCover: forecast.Day.CloudCover / 100, date: new Date(forecast.Date), @@ -47,7 +47,7 @@ export class WeatherService { sunrise: new Date(forecast.Sun.Rise), sunset: new Date(forecast.Sun.Set), })); - temp = (await this.http.get(`http://dataservice.accuweather.com/currentconditions/v1/${this.locationKey}?apikey=${environment.accuWeather}&details=true`).toPromise())[0]; + temp = (await this.http.get(`https://dataservice.accuweather.com/currentconditions/v1/${this.locationKey}?apikey=${environment.accuWeather}&details=true`).toPromise())[0]; Object.assign(this.weather[0], { cloudCover: temp.CloudCover / 100, current: temp.Temperature[this.metric ? 'Metric' : 'Imperial'].Value,