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
@Grab('org.jsoup:jsoup:1.7.1') | |
def doc = org.jsoup.Jsoup.connect("https://news.google.com/nwshp?hl=zh-TW&tab=wn").get() | |
doc.select("#s_POPULAR .titletext").each { | |
node-> | |
println "title=${node.text()}" | |
} |
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
@Grapes([ | |
@Grab('org.seleniumhq.selenium.client-drivers:selenium-java-client-driver:1.0.2'), | |
@Grab('org.seleniumhq.selenium:selenium-server:2.25.0'), | |
@GrabConfig(systemClassLoader=false, initContextClassLoader=true) | |
]) | |
import com.thoughtworks.selenium.* | |
import org.openqa.selenium.server.* | |
seleniumServer = new SeleniumServer() |
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
/** | |
* HttpBuilder Testing | |
*/ | |
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.2' ) | |
import groovyx.net.http.* | |
import static groovyx.net.http.ContentType.* | |
import static groovyx.net.http.Method.* | |
def http = new HTTPBuilder( 'http://localhost:8080' ) |
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
html { | |
head { | |
title(title) | |
} | |
body { | |
content() | |
} | |
} |
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
package mobilepackage | |
import io.gatling.core.Predef._ | |
import io.gatling.core.session._ | |
import io.gatling.http.Predef._ | |
import scala.concurrent.duration._ | |
import scala.util.parsing.json._ | |
import general._ | |
class LoginSimulation extends Simulation { |
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 | |
@Grab('org.apache.pdfbox:pdfbox:1.8.8') | |
import org.apache.pdfbox.cos.COSArray | |
import org.apache.pdfbox.cos.COSString | |
import org.apache.pdfbox.pdfparser.PDFStreamParser | |
import org.apache.pdfbox.pdfwriter.ContentStreamWriter | |
import org.apache.pdfbox.pdmodel.PDDocument | |
import org.apache.pdfbox.pdmodel.PDPage | |
import org.apache.pdfbox.pdmodel.common.PDStream | |
import org.apache.pdfbox.util.PDFOperator |
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 com.sun.net.httpserver.Filter; | |
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.InetSocketAddress; | |
import java.util.Arrays; | |
import java.util.List; |