├── .gitignore ├── .travis.yml ├── README.md ├── index.js ├── npm-postinstall.sh └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *~ 3 | .* 4 | example.js 5 | Procfile 6 | node_modules 7 | phantomjs* 8 | slimerjs* 9 | tmp 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | before_install: 2 | # init xvfb 3 | # http://docs.travis-ci.com/user/gui-and-headless-browsers/ 4 | - "export DISPLAY=:99.0 && sh -e /etc/init.d/xvfb start" 5 | branches: 6 | only: 7 | - alpha 8 | - beta 9 | - master 10 | env: 11 | global: 12 | # this value is auto-generated by shAesEncryptTravis 13 | - secure: bgYDm18RAREoe0PAw7dDOJG3Z0NoLoq/U1XMnv5aqxOXPPkgkLO3PigiVy0JWk/ANUkJRuqLc5Bxdu+wZ45XexB2E/5BFYdfJ1q2WL+Ew0klwNUTKC77FXKDKXcqVXWpFHzRQ0XH7bYlVNje04SqKWtq95wDNkTOFjoj94ciBeg= # AES_256_KEY 14 | # this value is auto-generated by shAesEncryptTravis 15 | # - AES_ENCRYPTED_SH: YWViOTA1NGFhMDY2OTkzMmU1YzQ4OWE3YWMxMGI2ODkg19/ESNJl6FOZnHO9ZccPCcl791QzaW6OZoJuB2A3D4bwtpqmhZD9Q3fVrX7/9mcXwdFlUggbndOLCesnNLW6kg8zU+kH4Gch9Ro7R76eSBCfeIx6BLNl/zoDuT3s3X48R2PVVd0Ev+kirok44Sh0PmSrIzMiEy8rnUVBdTzhakfVfqLW+2FHmdrLeKq6+tX0NNYik9qyiqjPEg5j+H5j8bx/Y2KIshvFsRfCesiHTLwlycf9jkgUAWJ4CDCwrwwZSnmLZozQgAAuEQxEMi/1KmHXske+V+hRkiEG6CbM3w5kPfDXeMlKlWMSKhuN5WyN3F29sW1kZd96N731XJVUA+bh5904duQE8Qo3C0WkHzVauLHAU8nQ+G0/0FdD6TLOWy7ORMc/TmmKiSzMElbxezXzsEGgufVvuw1rp8fEqdQtMYeJwQ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ebCPDINr14+Hr6JffYf0gcmW3yQvHxNYpp5rXAlVC7mMrCqYi8WWMR573Z+f4CZwQl+prO+8LaXqKFWZfqnzHyZCwOoxJ7gHwbQOMCrJ/n47v6pmA2LQK7WmS9MDks0kpBHHbhKRJh4lvFt0QikgZJAZmzS8D0zZVamkxdzeiQnBsajrkpl7aOZfqj+leqKYsDUfSM+T6bQSx12bejNF9jTkAPMM0Z852uYZlCb6LOjY2oX2g5szWbVqhCwgVLZSY+N/NdW/CDV8jFaDOb7EvFtcALgTJ/r6yQevsJr+Qg8suzX7wOuK/XIpgMshpwM6H5vxyEriEvDSvkHjRcrLuAUNQMQSAG3nzpZw9ba2a2ttlKsgLEZW+rZa6m7gCl0fEfrSVVfyCfeDm9O3NtK88Ah7OT1/0UmKlxQkQ3ghlpkihEdt8sVJ9LhWhrwxUETOZ75+KV80Xd6RPNFuWnjDWeMHgfUtJGuhxewVQNbbEk9NmcSMML+Z21fs6ihb4l6Yqxqn6Yp06XiGRWJORh5SMOnPdSEQS7A6tf+cfBhV4kKH6hxrL8Zgh+jisIykTWBp13yXE3zzj7XxHkdUEiqgjnrinErpfznIRHpKUH4uyEmpv6O5V4N/SnTk3iFqbAR0CWhied/+ZKJLsRDHiNAv4UuP7hcU9xV99YdipnN0uEADCfYfaZNew5fVTB09xeTDpwKrQ8QrmIFaLyFrcB7RtQmAASyR638H5w673QzpFXsIPoYtDvYGhNP7jfqW0 # AES_ENCRYPTED_SH 16 | language: 17 | - node_js 18 | node_js: 19 | - "0.12" 20 | script: 21 | - npm run-script build-ci 22 | # http://docs.travis-ci.com/user/workers/container-based-infrastructure 23 | sudo: 24 | false 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | phantomjs-lite 2 | ============== 3 | minimal npm installer for phantomjs and slimerjs with zero npm-dependencies 4 | 5 | [![NPM](https://img.shields.io/npm/v/phantomjs-lite.svg?style=flat-square)](https://www.npmjs.org/package/phantomjs-lite) 6 | 7 | 8 | 9 | # screen-capture 10 | [![screen-capture](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.slimerjs.png)](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.slimerjs.png) 11 | 12 | 13 | 14 | # build-status [![travis-ci.org build-status](https://api.travis-ci.org/kaizhu256/node-phantomjs-lite.svg)](https://travis-ci.org/kaizhu256/node-phantomjs-lite) 15 | 16 | | git-branch : | [master](https://github.com/kaizhu256/node-phantomjs-lite/tree/master) | [beta](https://github.com/kaizhu256/node-phantomjs-lite/tree/beta) | [alpha](https://github.com/kaizhu256/node-phantomjs-lite/tree/alpha)| 17 | |--:|:--|:--|:--| 18 | | build-artifacts : | [![build-artifacts](https://kaizhu256.github.io/node-phantomjs-lite/glyphicons_144_folder_open.png)](https://github.com/kaizhu256/node-phantomjs-lite/tree/gh-pages/build..master..travis-ci.org) | [![build-artifacts](https://kaizhu256.github.io/node-phantomjs-lite/glyphicons_144_folder_open.png)](https://github.com/kaizhu256/node-phantomjs-lite/tree/gh-pages/build..beta..travis-ci.org) | [![build-artifacts](https://kaizhu256.github.io/node-phantomjs-lite/glyphicons_144_folder_open.png)](https://github.com/kaizhu256/node-phantomjs-lite/tree/gh-pages/build..alpha..travis-ci.org)| 19 | 20 | #### master branch 21 | - stable branch 22 | - HEAD should be tagged, npm-published package 23 | 24 | #### beta branch 25 | - semi-stable branch 26 | - HEAD should be latest, npm-published package 27 | 28 | #### alpha branch 29 | - unstable branch 30 | - HEAD is arbitrary 31 | - commit history may be rewritten 32 | 33 | 34 | 35 | # documentation 36 | - requires unzip to be installed on os 37 | - installs phantomjs@1.9.8 38 | - installs slimerjs@0.9.6 39 | 40 | 41 | 42 | # quickstart screen-capture example 43 | 44 | #### to run this example, follow the instruction in the script below 45 | - example.sh 46 | 47 | ```shell 48 | # example.sh 49 | 50 | # this shell script will 51 | # npm install phantomjs-lite 52 | # screen-capture http://phantomjs.org/screen-capture.html 53 | 54 | # instruction 55 | # 1. copy and paste this entire shell script into a console and press enter 56 | # 2. view ./screen-capture.phantomjs.png 57 | # 3. view ./screen-capture.slimerjs.png 58 | 59 | shExampleSh() { 60 | # npm install phantomjs-lite 61 | npm install phantomjs-lite || return $? 62 | 63 | # screen-capture http://phantomjs.org/screen-capture.html 64 | local ARG0 || return $? 65 | for ARG0 in phantomjs slimerjs 66 | do 67 | node_modules/phantomjs-lite/index.js $ARG0 eval " 68 | var file, page, url; 69 | file = '$(pwd)/screen-capture.$ARG0.png'; 70 | page = require('webpage').create(); 71 | url = 'http://phantomjs.org/screen-capture.html'; 72 | // init webpage size and offset 73 | page.clipRect = { height: 768, left: 0, top: 0, width: 1024 }; 74 | page.viewportSize = { height: 768, width: 1024 }; 75 | // open webpage 76 | page.open(url, function () { 77 | console.log('$ARG0 opened ' + url); 78 | // after opening webpage, 79 | // wait 1000 ms and then create screen-capture and exit 80 | setTimeout(function () { 81 | page.render(file); 82 | console.log('$ARG0 created screen-capture file://' + file); 83 | phantom.exit(); 84 | }, 1000); 85 | }); 86 | // init 30000 ms timeout error 87 | setTimeout(function () { 88 | console.error('$ARG0 timeout error'); 89 | phantom.exit(1); 90 | }, 30000); 91 | " || return $? 92 | done 93 | } 94 | shExampleSh 95 | ``` 96 | 97 | #### output from shell 98 | [![screen-capture](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.testExampleSh.svg)](https://travis-ci.org/kaizhu256/node-phantomjs-lite) 99 | 100 | #### output from phantomjs 101 | [![screen-capture](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.phantomjs.png)](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.phantomjs.png) 102 | 103 | #### output from slimerjs 104 | [![screen-capture](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.slimerjs.png)](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.slimerjs.png) 105 | 106 | 107 | 108 | # npm-dependencies 109 | - none 110 | 111 | 112 | 113 | # package-listing 114 | - phantomjs binary dynamically downloaded from https://bitbucket.org/ariya/phantomjs/downloads/ 115 | - slimerjs binary dynamically downloaded from https://download.slimerjs.org/releases/ 116 | 117 | [![screen-capture](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.gitLsTree.svg)](https://github.com/kaizhu256/node-phantomjs-lite) 118 | 119 | 120 | 121 | # package.json 122 | ```json 123 | { 124 | "author": "kai zhu ", 125 | "bin": { 126 | "phantomjs-lite" : "index.js", 127 | "phantomjs" : "phantomjs", 128 | "slimerjs" : "slimerjs" 129 | }, 130 | "description": "minimal npm installer for phantomjs and slimerjs \ 131 | with zero npm-dependencies", 132 | "devDependencies": { 133 | "utility2": "^2015.8.3" 134 | }, 135 | "keywords": [ 136 | "browser", 137 | "capture", 138 | "headless", "headless-browser", 139 | "phantom", "phantomjs", 140 | "scrape", "screen", "screen-capture", "screencapture", "screenshot", 141 | "slimer", "slimerjs", 142 | "web" 143 | ], 144 | "license": "MIT", 145 | "name": "phantomjs-lite", 146 | "os": ["darwin", "linux"], 147 | "repository" : { 148 | "type" : "git", 149 | "url" : "https://github.com/kaizhu256/node-phantomjs-lite.git" 150 | }, 151 | "scripts": { 152 | "build-ci": "node_modules/.bin/utility2 shRun shReadmeBuild", 153 | "postinstall": "./npm-postinstall.sh", 154 | "preinstall": "touch phantomjs slimerjs", 155 | "test": "node_modules/.bin/utility2 shRun shReadmeExportPackageJson && \ 156 | for ARG0 in phantomjs slimerjs; \ 157 | do \ 158 | printf \"testing $ARG0\n\" || exit $?; \ 159 | [ \ 160 | $(./index.js $ARG0 eval 'console.log(\"hello\"); phantom.exit();') = 'hello' \ 161 | ] || exit $?; \ 162 | printf \"passed\n\" || exit $?; \ 163 | done" 164 | }, 165 | "version": "2015.8.2" 166 | } 167 | ``` 168 | 169 | 170 | 171 | # todo 172 | - add codeship.io build 173 | - upgrade to phantomjs@2.x 174 | - none 175 | 176 | 177 | 178 | # change since fb22ca38 179 | - npm publish 2015.8.2 180 | - upgrade to slimerjs@0.9.6 181 | - none 182 | 183 | 184 | 185 | # changelog of last 50 commits 186 | [![screen-capture](https://kaizhu256.github.io/node-phantomjs-lite/build/screen-capture.gitLog.svg)](https://github.com/kaizhu256/node-phantomjs-lite/commits) 187 | 188 | 189 | 190 | # internal build-script 191 | - build.sh 192 | 193 | ```shell 194 | # build.sh 195 | 196 | # this shell script will run the build for this package 197 | 198 | shBuild() { 199 | # this function will run the main build 200 | # init env 201 | export npm_config_mode_slimerjs=1 || return $? 202 | . node_modules/.bin/utility2 && shInit || return $? 203 | 204 | # run npm-test on published package 205 | shRun shNpmTestPublished || return $? 206 | 207 | # test example shell script 208 | MODE_BUILD=testExampleSh shRunScreenCapture shReadmeTestSh example.sh || return $? 209 | # copy phantomjs screen-capture to $npm_config_dir_build 210 | cp /tmp/app/screen-capture.*.png $npm_config_dir_build || return $? 211 | 212 | # run npm-test 213 | MODE_BUILD=npmTest shRunScreenCapture npm test || return $? 214 | } 215 | shBuild 216 | 217 | # save exit-code 218 | EXIT_CODE=$? 219 | # create package-listing 220 | MODE_BUILD=gitLsTree shRunScreenCapture shGitLsTree || exit $? 221 | # create recent changelog of last 50 commits 222 | MODE_BUILD=gitLog shRunScreenCapture git log -50 --pretty="%ai\u000a%B" || exit $? 223 | # upload build-artifacts to github, and if number of commits > 16, then squash older commits 224 | COMMIT_LIMIT=16 shBuildGithubUpload || exit $? 225 | exit $EXIT_CODE 226 | ``` 227 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /*jslint 3 | evil: true, 4 | maxerr: 8, 5 | maxlen: 96, 6 | node: true, 7 | nomen: true, 8 | */ 9 | (function (self) { 10 | 'use strict'; 11 | var local; 12 | 13 | 14 | 15 | // run shared js-env code 16 | (function () { 17 | // init local 18 | local = {}; 19 | local.modeJs = (function () { 20 | try { 21 | return self.phantom.version && 22 | typeof require('webpage').create === 'function' && 23 | 'phantom'; 24 | } catch (errorCaughtPhantom) { 25 | return module.exports && 26 | typeof process.versions.node === 'string' && 27 | typeof require('http').createServer === 'function' && 28 | 'node'; 29 | } 30 | }()); 31 | }()); 32 | switch (local.modeJs) { 33 | 34 | 35 | 36 | // run node js-env code 37 | case 'node': 38 | module.exports = require('./package.json'); 39 | module.exports.__dirname = __dirname; 40 | module.exports.processSpawn = function (arg0, argList, options) { 41 | arg0 = arg0 || process.argv[2]; 42 | if (arg0 === 'alljs') { 43 | module.exports.processSpawn('phantomjs', argList, options); 44 | module.exports.processSpawn('slimerjs', argList, options); 45 | return; 46 | } 47 | argList = argList || process.argv.slice(3); 48 | options = options || { stdio: [0, 1, 2] }; 49 | switch (argList[0]) { 50 | case 'eval': 51 | argList = [__filename].concat(argList); 52 | break; 53 | } 54 | return require('child_process').spawn(__dirname + '/' + arg0, argList, options); 55 | }; 56 | // run the cli 57 | if (module === require.main) { 58 | module.exports.processSpawn(); 59 | } 60 | break; 61 | 62 | 63 | 64 | // run phantom js-env code 65 | case 'phantom': 66 | // require modules 67 | local.system = require('system'); 68 | switch (local.system.args[1]) { 69 | case 'eval': 70 | eval(local.system.args[2]); 71 | break; 72 | default: 73 | self.phantom.exit(); 74 | break; 75 | } 76 | break; 77 | } 78 | }(this)); 79 | -------------------------------------------------------------------------------- /npm-postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | shDownloadAndInstall() { 3 | # this function will download and install phantomjs and slimerjs 4 | if [ ! -f $FILE_BIN ] 5 | then 6 | # check if unzip is installed 7 | if ! (unzip > /dev/null 2>&1) 8 | then 9 | printf "ERROR - phantomjs-lite requires 'unzip' to install\n" 1>&2 || return $? 10 | return 1 11 | fi 12 | # download phantomjs 13 | if [ ! -f $FILE_TMP.downloaded ] 14 | then 15 | printf "downloading $FILE_URL to $FILE_TMP ...\n" || return $? 16 | mkdir -p $TMPDIR2 && curl -Ls -o $FILE_TMP $FILE_URL || return $? 17 | touch $FILE_TMP.downloaded || return $? 18 | fi 19 | # unzip phantomjs 20 | $FILE_UNZIP $FILE_TMP || return $? 21 | fi 22 | # install phantomjs 23 | rm -f $FILE_LINK && ln -s $FILE_BIN $FILE_LINK || return $? 24 | } 25 | 26 | shNpmPostinstall() { 27 | # this function will run npm postinstall 28 | TMPDIR2=/tmp/$USER 29 | case $(uname) in 30 | Darwin) 31 | # download and install phantomjs 32 | FILE_BIN=phantomjs-1.9.8-macosx/bin/phantomjs 33 | FILE_LINK=phantomjs 34 | FILE_TMP=$TMPDIR2/phantomjs-1.9.8-macosx.zip 35 | FILE_URL=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-macosx.zip 36 | FILE_UNZIP="unzip -q" 37 | shDownloadAndInstall || return $? 38 | # download and install slimerjs 39 | FILE_BIN=slimerjs-0.9.6/slimerjs 40 | FILE_LINK=slimerjs 41 | FILE_TMP=$TMPDIR2/slimerjs-0.9.6.zip 42 | FILE_URL=https://download.slimerjs.org/releases/0.9.6/slimerjs-0.9.6.zip 43 | FILE_UNZIP="unzip -q" 44 | shDownloadAndInstall || return $? 45 | ;; 46 | Linux) 47 | # download and install phantomjs 48 | FILE_BIN=phantomjs-1.9.8-linux-x86_64/bin/phantomjs 49 | FILE_LINK=phantomjs 50 | FILE_TMP=$TMPDIR2/phantomjs-1.9.8-linux-x86_64.tar.bz2 51 | FILE_URL=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 52 | FILE_UNZIP="tar -xjf" 53 | shDownloadAndInstall || return $? 54 | # download and install slimerjs 55 | FILE_BIN=slimerjs-0.9.6/slimerjs 56 | FILE_LINK=slimerjs 57 | FILE_TMP=$TMPDIR2/slimerjs-0.9.6.zip 58 | FILE_URL=https://download.slimerjs.org/releases/0.9.6/slimerjs-0.9.6.zip 59 | FILE_UNZIP="unzip -q" 60 | shDownloadAndInstall || return $? 61 | ;; 62 | esac 63 | } 64 | 65 | # run npm postinstall 66 | shNpmPostinstall 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "kai zhu ", 3 | "bin": { 4 | "phantomjs-lite" : "index.js", 5 | "phantomjs" : "phantomjs", 6 | "slimerjs" : "slimerjs" 7 | }, 8 | "description": "minimal npm installer for phantomjs and slimerjs with zero npm-dependencies", 9 | "devDependencies": { 10 | "utility2": "^2015.8.3" 11 | }, 12 | "keywords": [ 13 | "browser", 14 | "capture", 15 | "headless", "headless-browser", 16 | "phantom", "phantomjs", 17 | "scrape", "screen", "screen-capture", "screencapture", "screenshot", 18 | "slimer", "slimerjs", 19 | "web" 20 | ], 21 | "license": "MIT", 22 | "name": "phantomjs-lite", 23 | "os": ["darwin", "linux"], 24 | "repository" : { 25 | "type" : "git", 26 | "url" : "https://github.com/kaizhu256/node-phantomjs-lite.git" 27 | }, 28 | "scripts": { 29 | "build-ci": "node_modules/.bin/utility2 shRun shReadmeBuild", 30 | "postinstall": "./npm-postinstall.sh", 31 | "preinstall": "touch phantomjs slimerjs", 32 | "test": "node_modules/.bin/utility2 shRun shReadmeExportPackageJson && for ARG0 in phantomjs slimerjs; do printf \"testing $ARG0\n\" || exit $?; [ $(./index.js $ARG0 eval 'console.log(\"hello\"); phantom.exit();') = 'hello' ] || exit $?; printf \"passed\n\" || exit $?; done" 33 | }, 34 | "version": "2015.8.2" 35 | } --------------------------------------------------------------------------------