Created
April 25, 2010 17:18
-
-
Save marcelmaatkamp/378548 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
#!/usr/bin/env groovy | |
import groovyx.net.http.* | |
import static groovyx.net.http.Method.GET | |
import static groovyx.net.http.ContentType.HTML | |
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0-SNAPSHOT' ) | |
def http = new HTTPBuilder( 'https://www.google.com' ) | |
http.request( GET, HTML ) { req -> | |
uri.path = "/" | |
response.success = { resp, page -> | |
def properties = new Properties() | |
properties.load( | |
new ByteArrayInputStream( | |
page.HEAD.SCRIPT.text().replace(',','').replace('"','').getBytes() | |
) | |
) | |
println "properties: "+properties | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment