Skip to content

Commit

Permalink
Merge pull request #868 from ekchang/master
Browse files Browse the repository at this point in the history
Fix Yahoo Weather Extension
  • Loading branch information
romannurik committed May 11, 2016
2 parents 132fa1c + 54679e6 commit 2b596a5
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -185,7 +185,7 @@ public static LocationInfo getLocationInfo(Location location) throws CantGetWeat

// first=tagname (admin1, locality3) second=woeid
String primaryWoeid = null;
List<Pair<String,String>> alternateWoeids = new ArrayList<Pair<String, String>>();
List<Pair<String, String>> alternateWoeids = new ArrayList<Pair<String, String>>();

HttpURLConnection connection = null;
try {
Expand Down Expand Up @@ -389,7 +389,10 @@ public static List<LocationSearchResult> findLocationsAutocomplete(String starts

private static String buildWeatherQueryUrl(String woeid) {
// http://developer.yahoo.com/weather/
return "http://weather.yahooapis.com/forecastrss?w=" + woeid + "&u=" + sWeatherUnits;
String query = "https://query.yahooapis.com/v1/public/yql?q="
+ "SELECT * FROM weather.forecast WHERE woeid=" + woeid
+ " and u=\'" + sWeatherUnits + "\'";
return query.replaceAll(" ", "%20");
}

private static String buildPlaceSearchUrl(Location l) {
Expand Down

0 comments on commit 2b596a5

Please sign in to comment.