diff --git a/web/Makefile b/web/Makefile index 1217206..dd112e9 100644 --- a/web/Makefile +++ b/web/Makefile @@ -12,7 +12,7 @@ CSS_COMPILER = utils/yuicompressor --type css .PHONY: all clean -all: $(JS_MIN) $(CSS_MIN) +all: $(JS_MIN) $(CSS_MIN) utils/ServerExecute.class %.min.js: %.js @echo "Compiling javascript" $< @@ -30,6 +30,13 @@ $(CSS_MIN): $(CSS_MIN_FILES) @echo "Assembling compiled stylesheets" @cat $^ > $@ +empty := +space := $(empty) $(empty) +classpath := $(subst $(space),:,$(wildcard utils/htmlunit-2.8/*.jar)) +utils/ServerExecute.class: utils/ServerExecute.java + @echo "Building HtmlUnit wrapper." + @javac -classpath $(classpath) -d utils $^ + clean: @rm -fv $(JS_MIN) $(JS_MIN_FILES) $(CSS_MIN) $(CSS_MIN_FILES) diff --git a/web/utils/.gitignore b/web/utils/.gitignore new file mode 100644 index 0000000..6b468b6 --- /dev/null +++ b/web/utils/.gitignore @@ -0,0 +1 @@ +*.class diff --git a/web/utils/ServerExecute.java b/web/utils/ServerExecute.java new file mode 100644 index 0000000..e5dd0b1 --- /dev/null +++ b/web/utils/ServerExecute.java @@ -0,0 +1,19 @@ +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; + +public class ServerExecute { + public static void main(String[] args) { + if (args.length != 1) { + System.err.println("You must give a url as an argument."); + return; + } + try { + final WebClient webClient = new WebClient(); + HtmlPage page = webClient.getPage(args[0]); + webClient.waitForBackgroundJavaScript(2000); + System.out.println(page.asXml()); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/web/utils/htmlunit-2.8/apache-mime4j-0.6.jar b/web/utils/htmlunit-2.8/apache-mime4j-0.6.jar new file mode 100644 index 0000000..1d2282c Binary files /dev/null and b/web/utils/htmlunit-2.8/apache-mime4j-0.6.jar differ diff --git a/web/utils/htmlunit-2.8/commons-codec-1.4.jar b/web/utils/htmlunit-2.8/commons-codec-1.4.jar new file mode 100644 index 0000000..458d432 Binary files /dev/null and b/web/utils/htmlunit-2.8/commons-codec-1.4.jar differ diff --git a/web/utils/htmlunit-2.8/commons-collections-3.2.1.jar b/web/utils/htmlunit-2.8/commons-collections-3.2.1.jar new file mode 100644 index 0000000..c35fa1f Binary files /dev/null and b/web/utils/htmlunit-2.8/commons-collections-3.2.1.jar differ diff --git a/web/utils/htmlunit-2.8/commons-io-1.4.jar b/web/utils/htmlunit-2.8/commons-io-1.4.jar new file mode 100644 index 0000000..133dc6c Binary files /dev/null and b/web/utils/htmlunit-2.8/commons-io-1.4.jar differ diff --git a/web/utils/htmlunit-2.8/commons-lang-2.4.jar b/web/utils/htmlunit-2.8/commons-lang-2.4.jar new file mode 100644 index 0000000..532939e Binary files /dev/null and b/web/utils/htmlunit-2.8/commons-lang-2.4.jar differ diff --git a/web/utils/htmlunit-2.8/commons-logging-1.1.1.jar b/web/utils/htmlunit-2.8/commons-logging-1.1.1.jar new file mode 100644 index 0000000..1deef14 Binary files /dev/null and b/web/utils/htmlunit-2.8/commons-logging-1.1.1.jar differ diff --git a/web/utils/htmlunit-2.8/cssparser-0.9.5.jar b/web/utils/htmlunit-2.8/cssparser-0.9.5.jar new file mode 100644 index 0000000..9fc2767 Binary files /dev/null and b/web/utils/htmlunit-2.8/cssparser-0.9.5.jar differ diff --git a/web/utils/htmlunit-2.8/htmlunit-2.8.jar b/web/utils/htmlunit-2.8/htmlunit-2.8.jar new file mode 100644 index 0000000..0c9b0f8 Binary files /dev/null and b/web/utils/htmlunit-2.8/htmlunit-2.8.jar differ diff --git a/web/utils/htmlunit-2.8/htmlunit-core-js-2.8.jar b/web/utils/htmlunit-2.8/htmlunit-core-js-2.8.jar new file mode 100644 index 0000000..a47a832 Binary files /dev/null and b/web/utils/htmlunit-2.8/htmlunit-core-js-2.8.jar differ diff --git a/web/utils/htmlunit-2.8/httpclient-4.0.1.jar b/web/utils/htmlunit-2.8/httpclient-4.0.1.jar new file mode 100644 index 0000000..ad32285 Binary files /dev/null and b/web/utils/htmlunit-2.8/httpclient-4.0.1.jar differ diff --git a/web/utils/htmlunit-2.8/httpcore-4.0.1.jar b/web/utils/htmlunit-2.8/httpcore-4.0.1.jar new file mode 100644 index 0000000..4aef35e Binary files /dev/null and b/web/utils/htmlunit-2.8/httpcore-4.0.1.jar differ diff --git a/web/utils/htmlunit-2.8/httpmime-4.0.1.jar b/web/utils/htmlunit-2.8/httpmime-4.0.1.jar new file mode 100644 index 0000000..85a0821 Binary files /dev/null and b/web/utils/htmlunit-2.8/httpmime-4.0.1.jar differ diff --git a/web/utils/htmlunit-2.8/nekohtml-1.9.14.jar b/web/utils/htmlunit-2.8/nekohtml-1.9.14.jar new file mode 100644 index 0000000..ba65542 Binary files /dev/null and b/web/utils/htmlunit-2.8/nekohtml-1.9.14.jar differ diff --git a/web/utils/htmlunit-2.8/sac-1.3.jar b/web/utils/htmlunit-2.8/sac-1.3.jar new file mode 100644 index 0000000..39b92b1 Binary files /dev/null and b/web/utils/htmlunit-2.8/sac-1.3.jar differ diff --git a/web/utils/htmlunit-2.8/serializer-2.7.1.jar b/web/utils/htmlunit-2.8/serializer-2.7.1.jar new file mode 100644 index 0000000..99f98db Binary files /dev/null and b/web/utils/htmlunit-2.8/serializer-2.7.1.jar differ diff --git a/web/utils/htmlunit-2.8/xalan-2.7.1.jar b/web/utils/htmlunit-2.8/xalan-2.7.1.jar new file mode 100644 index 0000000..458fa73 Binary files /dev/null and b/web/utils/htmlunit-2.8/xalan-2.7.1.jar differ diff --git a/web/utils/htmlunit-2.8/xercesImpl-2.9.1.jar b/web/utils/htmlunit-2.8/xercesImpl-2.9.1.jar new file mode 100644 index 0000000..547f563 Binary files /dev/null and b/web/utils/htmlunit-2.8/xercesImpl-2.9.1.jar differ diff --git a/web/utils/htmlunit-2.8/xml-apis-1.3.04.jar b/web/utils/htmlunit-2.8/xml-apis-1.3.04.jar new file mode 100644 index 0000000..d42c0ea Binary files /dev/null and b/web/utils/htmlunit-2.8/xml-apis-1.3.04.jar differ diff --git a/web/utils/serverexecute b/web/utils/serverexecute new file mode 100755 index 0000000..af4fa68 --- /dev/null +++ b/web/utils/serverexecute @@ -0,0 +1,3 @@ +#!/bin/sh +cd $(dirname $0) +java -classpath $(for i in htmlunit-2.8/*; do echo $i; done|tr '\n' ':') ServerExecute $@