Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yahoo API change #25

Merged
merged 1 commit into from
Mar 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mod_weather_gk4/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function getData() {
if($this->config['source'] == 'google'){
curl_setopt($curl, CURLOPT_URL, 'http://www.google.com/ig/api?weather='.$this->config['city'].'&hl='.$this->config['language'].$encoding_url);
} else {
curl_setopt($curl, CURLOPT_URL, 'http://weather.yahooapis.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit']);
curl_setopt($curl, CURLOPT_URL, 'http://xml.weather.yahoo.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit']);
}
// timeout in seconds
curl_setopt($curl, CURLOPT_TIMEOUT, 5);
Expand All @@ -247,7 +247,7 @@ function getData() {
$encoding_url = ($this->config['encoding'] != '') ? '&oe='.$this->config['encoding'] : '';
$this->content = file_get_contents('http://www.google.com/ig/api?weather='.$this->config['city'].'&hl='.$this->config['language'].$encoding_url);
} else {
$this->content = file_get_contents('http://weather.yahooapis.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit']);
$this->content = file_get_contents('http://xml.weather.yahoo.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit']);
}
} else {
$this->error = 'cURL extension and file_get_content method is not available on your server';
Expand Down Expand Up @@ -277,7 +277,7 @@ function getData() {
$encoding_url = ($this->config['encoding'] != '') ? '&oe='.$this->config['encoding'] : '';
curl_setopt($curl, CURLOPT_URL, 'http://www.google.com/ig/api?weather='.$this->config['city'].'&hl='.$this->config['language'].$encoding_url);
} else {
curl_setopt($curl, CURLOPT_URL, 'http://weather.yahooapis.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit']);
curl_setopt($curl, CURLOPT_URL, 'http://xml.weather.yahoo.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit']);
}
// timeout in seconds
curl_setopt($curl, CURLOPT_TIMEOUT, 20);
Expand All @@ -293,7 +293,7 @@ function getData() {
if($this->config['source'] == 'google'){
$this->content = file_get_contents('http://www.google.com/ig/api?weather='.$this->config['city'].'&hl='.$this->config['language'].$encoding_url);
} else {
$this->content = file_get_contents('http://weather.yahooapis.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit'].$encoding_url);
$this->content = file_get_contents('http://xml.weather.yahoo.com/forecastrss?w='.$this->config['WOEID']."&u=".$this->config['tempUnit'].$encoding_url);
}
} else {
$this->error = 'cURL extension and file_get_content method is not available on your server';
Expand Down Expand Up @@ -555,4 +555,4 @@ function F2Cel($value) {
return round((5/9) * ($value - 32)).'°C';
}
}
/*eof*/
/*eof*/