Created
March 12, 2011 21:45
-
-
Save chad/867586 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 org.apache.http.client._ | |
import org.apache.http.client.methods._ | |
import org.apache.http.impl.client._ | |
import scala.xml._ | |
object S { | |
def main(args : Array[String]) : Unit = { | |
val root = scala.xml.XML.load((new DefaultHttpClient).execute ( | |
new HttpGet("http://whoismyrepresentative.com/getall_sens_bystate.php?state="+args.head) | |
).getEntity.getContent) | |
root\"rep" foreach{(rep) => | |
println(rep.attribute("name").get) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment