|
@@ -66,7 +66,7 @@ discard block |
|
|
block discarded – undo |
|
66
|
66
|
$json = []; |
|
67
|
67
|
|
|
68
|
68
|
// Initialize CURL: |
|
69
|
|
- $ch = curl_init('http://api.ipstack.com/'. $ip . '?access_key=' . $this->apikey1 . ''); |
|
|
69
|
+ $ch = curl_init('http://api.ipstack.com/' . $ip . '?access_key=' . $this->apikey1 . ''); |
|
70
|
70
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
71
|
71
|
|
|
72
|
72
|
// Store the data: |
|
@@ -94,7 +94,7 @@ discard block |
|
|
block discarded – undo |
|
94
|
94
|
$location = $coords["lat"] . ',' . $coords["long"]; |
|
95
|
95
|
|
|
96
|
96
|
// Initialize CURL: |
|
97
|
|
- $ch = curl_init('https://api.darksky.net/forecast/'.$this->apikey2.'/'.$location.'?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=ca'); |
|
|
97
|
+ $ch = curl_init('https://api.darksky.net/forecast/' . $this->apikey2 . '/' . $location . '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=ca'); |
|
98
|
98
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
99
|
99
|
|
|
100
|
100
|
// Store the data: |
|
@@ -156,7 +156,7 @@ discard block |
|
|
block discarded – undo |
|
156
|
156
|
$location = $coords["lat"] . ',' . $coords["long"]; |
|
157
|
157
|
for ($i = 0; $i < $days; $i++) { |
|
158
|
158
|
$time = $this->getDayFormat("$i"); |
|
159
|
|
- $urls[] = 'https://api.darksky.net/forecast/'.$this->apikey2.'/'.$location.','.$time.'?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=auto'; |
|
|
159
|
+ $urls[] = 'https://api.darksky.net/forecast/' . $this->apikey2 . '/' . $location . ',' . $time . '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=auto'; |
|
160
|
160
|
} |
|
161
|
161
|
return $urls; |
|
162
|
162
|
} |
|
@@ -167,7 +167,7 @@ discard block |
|
|
block discarded – undo |
|
167
|
167
|
public function getDayFormat($day) |
|
168
|
168
|
{ |
|
169
|
169
|
$date = new \Datetime(); |
|
170
|
|
- $date->sub(new \DateInterval('P'. (intval($day) + 1) .'D')); |
|
|
170
|
+ $date->sub(new \DateInterval('P' . (intval($day) + 1) . 'D')); |
|
171
|
171
|
return $date->format('U'); |
|
172
|
172
|
} |
|
173
|
173
|
|