Created
January 7, 2015 23:46
-
-
Save kylecorry31/ae0f856837229f8a971d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.io._ | |
import scala.xml._ | |
def getWeatherInfo(id: String) = { | |
val url = "http://weather.yahooapis.com/forecastrss?w=" + id + "&u=f" | |
val response = io.Source.fromURL(url).mkString | |
var xmlResponse = XML.loadString(response) | |
println(xmlResponse \\ "location" \\ "@city", xmlResponse \\ "condition" \\ "@temp", xmlResponse \\ "condition" \\ "@text") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment