diff --git a/README.md b/README.md index acb8d4f..42b6a47 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,60 @@ -# SafaribooksonlineGetter4J -The auto download for Safari online book +# SafaribooksonlineGetter4J +The auto download for Safari online book + +### How to use it? +Execute the following command line: +``` +java -jar SafariBookGetter.jar -config W:\Book\default_config.xml +``` + +### Configuration items +``` + + + + +FF38 + + + +80 + +W:\Book\android-studio-essentials + +true + + + +https://www.safaribooksonline.com/accounts/login/ + +form + +0 + + + + + + + + + + + + + +http://techbus.safaribooksonline.com/book/programming/android/9781784397203 + +div.catalog_container a[href*='9781784397203'] + + + + +http://techbus.safaribooksonline.com/book/programming/android/9781784397203/android-studio-essentials/index_html + +a.next[title*='Next (Key: n)'] + + + +``` + diff --git a/dist/SafariBookGetter.jar b/dist/SafariBookGetter.jar new file mode 100644 index 0000000..cb1acc0 Binary files /dev/null and b/dist/SafariBookGetter.jar differ diff --git a/src/openthinks/others/webpages/safaribook/SafariBookLaunch.java b/src/openthinks/others/webpages/safaribook/SafariBookLaunch.java index 1376f7f..6467d80 100644 --- a/src/openthinks/others/webpages/safaribook/SafariBookLaunch.java +++ b/src/openthinks/others/webpages/safaribook/SafariBookLaunch.java @@ -52,13 +52,13 @@ protected static SafariBookConfigure initialConfig(String[] args) { // config.setNextChainPageAnchorSelector(""); // config.setProxyHost(""); // config.setProxyPort(80); - String config_path = "W:\\book\\config_default.xml"; + String config_path = null; if (args != null && args.length > 0) { if ("-help".equalsIgnoreCase(args[0])) { showUsage(); } if ("-config".equalsIgnoreCase(args[0])) { - if (args.length > 2) { + if (args.length >= 2) { config_path = args[1]; } else { System.out.println("miss configure file path!");