Skip to content

Instantly share code, notes, and snippets.

@chad
Created March 12, 2011 21:45
Show Gist options
  • Save chad/867586 to your computer and use it in GitHub Desktop.
Save chad/867586 to your computer and use it in GitHub Desktop.
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