phantomjs.rb 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/CHANGELOG +11 -0
- data/MIT-LICENSE +21 -0
- data/lib/phantomjs.rb +4 -2
- data/lib/phantomjs/version.rb +1 -1
- data/phantomjs.rb.gemspec +5 -1
- metadata +20 -186
- data/vendor/phantomjs-1.4.1_OSX/ChangeLog +0 -145
- data/vendor/phantomjs-1.4.1_OSX/LICENSE.BSD +0 -22
- data/vendor/phantomjs-1.4.1_OSX/README.md +0 -33
- data/vendor/phantomjs-1.4.1_OSX/bin/Info.plist +0 -12
- data/vendor/phantomjs-1.4.1_OSX/bin/phantomjs +0 -0
- data/vendor/phantomjs-1.4.1_OSX/examples/arguments.coffee +0 -6
- data/vendor/phantomjs-1.4.1_OSX/examples/arguments.js +0 -8
- data/vendor/phantomjs-1.4.1_OSX/examples/colorwheel.coffee +0 -46
- data/vendor/phantomjs-1.4.1_OSX/examples/colorwheel.js +0 -51
- data/vendor/phantomjs-1.4.1_OSX/examples/countdown.coffee +0 -8
- data/vendor/phantomjs-1.4.1_OSX/examples/countdown.js +0 -9
- data/vendor/phantomjs-1.4.1_OSX/examples/detectsniff.coffee +0 -40
- data/vendor/phantomjs-1.4.1_OSX/examples/detectsniff.js +0 -57
- data/vendor/phantomjs-1.4.1_OSX/examples/direction.coffee +0 -29
- data/vendor/phantomjs-1.4.1_OSX/examples/direction.js +0 -34
- data/vendor/phantomjs-1.4.1_OSX/examples/echoToFile.coffee +0 -19
- data/vendor/phantomjs-1.4.1_OSX/examples/echoToFile.js +0 -22
- data/vendor/phantomjs-1.4.1_OSX/examples/features.js +0 -30
- data/vendor/phantomjs-1.4.1_OSX/examples/fibo.coffee +0 -8
- data/vendor/phantomjs-1.4.1_OSX/examples/fibo.js +0 -9
- data/vendor/phantomjs-1.4.1_OSX/examples/follow.coffee +0 -54
- data/vendor/phantomjs-1.4.1_OSX/examples/follow.js +0 -59
- data/vendor/phantomjs-1.4.1_OSX/examples/hello.coffee +0 -2
- data/vendor/phantomjs-1.4.1_OSX/examples/hello.js +0 -2
- data/vendor/phantomjs-1.4.1_OSX/examples/imagebin.coffee +0 -19
- data/vendor/phantomjs-1.4.1_OSX/examples/imagebin.js +0 -22
- data/vendor/phantomjs-1.4.1_OSX/examples/injectme.coffee +0 -23
- data/vendor/phantomjs-1.4.1_OSX/examples/injectme.js +0 -25
- data/vendor/phantomjs-1.4.1_OSX/examples/ipgeocode.coffee +0 -13
- data/vendor/phantomjs-1.4.1_OSX/examples/ipgeocode.js +0 -14
- data/vendor/phantomjs-1.4.1_OSX/examples/loadspeed.coffee +0 -17
- data/vendor/phantomjs-1.4.1_OSX/examples/loadspeed.js +0 -22
- data/vendor/phantomjs-1.4.1_OSX/examples/modernizr.js +0 -1116
- data/vendor/phantomjs-1.4.1_OSX/examples/movies.coffee +0 -13
- data/vendor/phantomjs-1.4.1_OSX/examples/movies.js +0 -14
- data/vendor/phantomjs-1.4.1_OSX/examples/netlog.coffee +0 -17
- data/vendor/phantomjs-1.4.1_OSX/examples/netlog.js +0 -23
- data/vendor/phantomjs-1.4.1_OSX/examples/netsniff.coffee +0 -109
- data/vendor/phantomjs-1.4.1_OSX/examples/netsniff.js +0 -131
- data/vendor/phantomjs-1.4.1_OSX/examples/outputEncoding.coffee +0 -12
- data/vendor/phantomjs-1.4.1_OSX/examples/outputEncoding.js +0 -16
- data/vendor/phantomjs-1.4.1_OSX/examples/phantomwebintro.coffee +0 -13
- data/vendor/phantomjs-1.4.1_OSX/examples/phantomwebintro.js +0 -19
- data/vendor/phantomjs-1.4.1_OSX/examples/pizza.coffee +0 -18
- data/vendor/phantomjs-1.4.1_OSX/examples/pizza.js +0 -20
- data/vendor/phantomjs-1.4.1_OSX/examples/post.coffee +0 -12
- data/vendor/phantomjs-1.4.1_OSX/examples/post.js +0 -14
- data/vendor/phantomjs-1.4.1_OSX/examples/rasterize.coffee +0 -22
- data/vendor/phantomjs-1.4.1_OSX/examples/rasterize.js +0 -27
- data/vendor/phantomjs-1.4.1_OSX/examples/render_multi_url.coffee +0 -48
- data/vendor/phantomjs-1.4.1_OSX/examples/render_multi_url.js +0 -60
- data/vendor/phantomjs-1.4.1_OSX/examples/run-jasmine.coffee +0 -59
- data/vendor/phantomjs-1.4.1_OSX/examples/run-jasmine.js +0 -77
- data/vendor/phantomjs-1.4.1_OSX/examples/run-qunit.coffee +0 -62
- data/vendor/phantomjs-1.4.1_OSX/examples/run-qunit.js +0 -74
- data/vendor/phantomjs-1.4.1_OSX/examples/scandir.coffee +0 -15
- data/vendor/phantomjs-1.4.1_OSX/examples/scandir.js +0 -21
- data/vendor/phantomjs-1.4.1_OSX/examples/seasonfood.coffee +0 -17
- data/vendor/phantomjs-1.4.1_OSX/examples/seasonfood.js +0 -19
- data/vendor/phantomjs-1.4.1_OSX/examples/simpleserver.coffee +0 -35
- data/vendor/phantomjs-1.4.1_OSX/examples/simpleserver.js +0 -40
- data/vendor/phantomjs-1.4.1_OSX/examples/sleepsort.coffee +0 -17
- data/vendor/phantomjs-1.4.1_OSX/examples/sleepsort.js +0 -24
- data/vendor/phantomjs-1.4.1_OSX/examples/technews.coffee +0 -17
- data/vendor/phantomjs-1.4.1_OSX/examples/technews.js +0 -16
- data/vendor/phantomjs-1.4.1_OSX/examples/tweets.coffee +0 -30
- data/vendor/phantomjs-1.4.1_OSX/examples/tweets.js +0 -36
- data/vendor/phantomjs-1.4.1_OSX/examples/unrandomize.coffee +0 -18
- data/vendor/phantomjs-1.4.1_OSX/examples/unrandomize.js +0 -24
- data/vendor/phantomjs-1.4.1_OSX/examples/useragent.coffee +0 -11
- data/vendor/phantomjs-1.4.1_OSX/examples/useragent.js +0 -14
- data/vendor/phantomjs-1.4.1_OSX/examples/version.coffee +0 -5
- data/vendor/phantomjs-1.4.1_OSX/examples/version.js +0 -5
- data/vendor/phantomjs-1.4.1_OSX/examples/waitfor.coffee +0 -48
- data/vendor/phantomjs-1.4.1_OSX/examples/waitfor.js +0 -57
- data/vendor/phantomjs-1.4.1_OSX/examples/weather.coffee +0 -48
- data/vendor/phantomjs-1.4.1_OSX/examples/weather.js +0 -57
- data/vendor/phantomjs-1.4.1_OSX/lib/jquery.js +0 -8374
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/ChangeLog +0 -177
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/LICENSE.BSD +0 -22
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/README.md +0 -33
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/bin/Info.plist +0 -12
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/bin/phantomjs +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/arguments.coffee +0 -7
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/arguments.js +0 -9
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/colorwheel.coffee +0 -46
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/colorwheel.js +0 -51
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/countdown.coffee +0 -8
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/countdown.js +0 -9
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/detectsniff.coffee +0 -41
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/detectsniff.js +0 -58
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/direction.coffee +0 -30
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/direction.js +0 -35
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/echoToFile.coffee +0 -20
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/echoToFile.js +0 -24
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/features.js +0 -30
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/fibo.coffee +0 -8
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/fibo.js +0 -9
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/follow.coffee +0 -29
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/follow.js +0 -34
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/hello.coffee +0 -2
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/hello.js +0 -2
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/imagebin.coffee +0 -20
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/imagebin.js +0 -23
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/injectme.coffee +0 -23
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/injectme.js +0 -25
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/ipgeocode.coffee +0 -13
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/ipgeocode.js +0 -14
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/loadspeed.coffee +0 -18
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/loadspeed.js +0 -23
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/modernizr.js +0 -1116
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/movies.coffee +0 -13
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/movies.js +0 -14
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/netlog.coffee +0 -18
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/netlog.js +0 -25
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/netsniff.coffee +0 -110
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/netsniff.js +0 -132
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/outputEncoding.coffee +0 -12
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/outputEncoding.js +0 -16
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/phantomwebintro.coffee +0 -13
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/phantomwebintro.js +0 -19
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/pizza.coffee +0 -18
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/pizza.js +0 -20
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/post.coffee +0 -12
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/post.js +0 -14
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/postserver.js +0 -34
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/printenv.js +0 -10
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/printmargins.js +0 -35
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/rasterize.coffee +0 -23
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/rasterize.js +0 -28
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/render_multi_url.coffee +0 -50
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/render_multi_url.js +0 -62
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/run-jasmine.coffee +0 -61
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/run-jasmine.js +0 -79
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/run-qunit.coffee +0 -64
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/run-qunit.js +0 -76
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/scandir.coffee +0 -16
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/scandir.js +0 -22
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/seasonfood.coffee +0 -17
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/seasonfood.js +0 -19
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/server.js +0 -43
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/serverkeepalive.js +0 -34
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/simpleserver.coffee +0 -38
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/simpleserver.js +0 -42
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/sleepsort.coffee +0 -20
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/sleepsort.js +0 -25
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/technews.coffee +0 -17
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/technews.js +0 -16
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/tweets.coffee +0 -31
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/tweets.js +0 -37
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/unrandomize.coffee +0 -18
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/unrandomize.js +0 -24
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/useragent.coffee +0 -11
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/useragent.js +0 -14
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/version.coffee +0 -5
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/version.js +0 -5
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/waitfor.coffee +0 -48
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/waitfor.js +0 -57
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/weather.coffee +0 -49
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/examples/weather.js +0 -58
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtCore.la +0 -28
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtCore.prl +0 -7
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtCore.so +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtCore.so.4 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtCore.so.4.8 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtCore.so.4.8.0 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtGui.la +0 -28
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtGui.prl +0 -7
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtGui.so +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtGui.so.4 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtGui.so.4.8 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtGui.so.4.8.0 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtNetwork.la +0 -28
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtNetwork.prl +0 -7
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtNetwork.so +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtNetwork.so.4 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtNetwork.so.4.8 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtNetwork.so.4.8.0 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtWebKit.la +0 -28
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtWebKit.prl +0 -6
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtWebKit.so +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtWebKit.so.4 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtWebKit.so.4.9 +0 -0
- data/vendor/phantomjs-1.5.0-liunx-x86-dynamic/lib/libQtWebKit.so.4.9.0 +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Redistribution and use in source and binary forms, with or without
|
|
2
|
-
modification, are permitted provided that the following conditions are met:
|
|
3
|
-
|
|
4
|
-
* Redistributions of source code must retain the above copyright
|
|
5
|
-
notice, this list of conditions and the following disclaimer.
|
|
6
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
7
|
-
notice, this list of conditions and the following disclaimer in the
|
|
8
|
-
documentation and/or other materials provided with the distribution.
|
|
9
|
-
* Neither the name of the <organization> nor the
|
|
10
|
-
names of its contributors may be used to endorse or promote products
|
|
11
|
-
derived from this software without specific prior written permission.
|
|
12
|
-
|
|
13
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
14
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
16
|
-
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
17
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
18
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
19
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
20
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
21
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
22
|
-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
PhantomJS ([www.phantomjs.org](http://phantomjs.org)) is a headless WebKit with JavaScript API.
|
|
2
|
-
|
|
3
|
-
It has **fast** and **native** support for DOM handling, CSS selector, JSON, Canvas, and SVG.
|
|
4
|
-
|
|
5
|
-
PhantomJS is cross-platform, it can be compiled for Linux, Windows, FreeBSD, and Mac OS X.
|
|
6
|
-
Refer to the [build instructions](http://code.google.com/p/phantomjs/wiki/BuildInstructions)
|
|
7
|
-
for details.
|
|
8
|
-
|
|
9
|
-
**Note**: If you are on Mac OS X, [read the notice](http://code.google.com/p/phantomjs/wiki/BuildInstructions#Mac_OS_X)
|
|
10
|
-
before you start using `brew` or `port` to install Qt and/or PhantomJS.
|
|
11
|
-
|
|
12
|
-
PhantomJS scripts can be written in JavaScript or [CoffeeScript](http://jashkenas.github.com/coffee-script/).
|
|
13
|
-
|
|
14
|
-
See also [quick start guide](http://code.google.com/p/phantomjs/wiki/QuickStart)
|
|
15
|
-
and more [advanced examples](http://code.google.com/p/phantomjs/wiki/ServiceIntegration)
|
|
16
|
-
which show various PhantomJS scripts, covering:
|
|
17
|
-
|
|
18
|
-
* getting driving direction
|
|
19
|
-
* showing weather forecast conditions
|
|
20
|
-
* finding pizza in New York
|
|
21
|
-
* looking up approximate location based on IP address
|
|
22
|
-
* pulling the list of seasonal food
|
|
23
|
-
* running regression tests from command line
|
|
24
|
-
* producing PDF version of a Wikipedia article
|
|
25
|
-
* rasterizing SVG to image
|
|
26
|
-
|
|
27
|
-
Do not forget to consult the concise [API Reference](http://code.google.com/p/phantomjs/wiki/Interface).
|
|
28
|
-
|
|
29
|
-
PhantomJS is based on [Qt](http://qt.nokia.com). There are two implementations, using C++ and Python.
|
|
30
|
-
|
|
31
|
-
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.4 ("Glory of the Snow").
|
|
32
|
-
|
|
33
|
-
If you want to contribute, please read the [Contribution Guide](http://code.google.com/p/phantomjs/wiki/ContributionGuide).
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
|
3
|
-
<plist version="0.9">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleExecutable</key>
|
|
6
|
-
<string>phantomjs</string>
|
|
7
|
-
<key>CFBundleIdentifier</key>
|
|
8
|
-
<string>org.phantomjs</string>
|
|
9
|
-
<key>LSUIElement</key>
|
|
10
|
-
<string>1</string>
|
|
11
|
-
</dict>
|
|
12
|
-
</plist>
|
|
Binary file
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
page = require('webpage').create()
|
|
2
|
-
|
|
3
|
-
page.viewportSize = { width: 400, height : 400 }
|
|
4
|
-
page.content = '<html><body><canvas id="surface"></canvas></body></html>'
|
|
5
|
-
|
|
6
|
-
page.evaluate ->
|
|
7
|
-
el = document.getElementById 'surface'
|
|
8
|
-
context = el.getContext '2d'
|
|
9
|
-
width = window.innerWidth
|
|
10
|
-
height = window.innerHeight
|
|
11
|
-
cx = width / 2
|
|
12
|
-
cy = height / 2
|
|
13
|
-
radius = width / 2.3
|
|
14
|
-
i = 0
|
|
15
|
-
|
|
16
|
-
el.width = width
|
|
17
|
-
el.height = height
|
|
18
|
-
imageData = context.createImageData(width, height)
|
|
19
|
-
pixels = imageData.data
|
|
20
|
-
|
|
21
|
-
for y in [0...height]
|
|
22
|
-
for x in [0...width]
|
|
23
|
-
i = i + 4
|
|
24
|
-
rx = x - cx
|
|
25
|
-
ry = y - cy
|
|
26
|
-
d = rx * rx + ry * ry
|
|
27
|
-
if d < radius * radius
|
|
28
|
-
hue = 6 * (Math.atan2(ry, rx) + Math.PI) / (2 * Math.PI)
|
|
29
|
-
sat = Math.sqrt(d) / radius
|
|
30
|
-
g = Math.floor(hue)
|
|
31
|
-
f = hue - g
|
|
32
|
-
u = 255 * (1 - sat)
|
|
33
|
-
v = 255 * (1 - sat * f)
|
|
34
|
-
w = 255 * (1 - sat * (1 - f))
|
|
35
|
-
pixels[i] = [255, v, u, u, w, 255, 255][g]
|
|
36
|
-
pixels[i + 1] = [w, 255, 255, v, u, u, w][g]
|
|
37
|
-
pixels[i + 2] = [u, u, w, 255, 255, v, u][g]
|
|
38
|
-
pixels[i + 3] = 255
|
|
39
|
-
|
|
40
|
-
context.putImageData imageData, 0, 0
|
|
41
|
-
document.body.style.backgroundColor = 'white'
|
|
42
|
-
document.body.style.margin = '0px'
|
|
43
|
-
|
|
44
|
-
page.render('colorwheel.png')
|
|
45
|
-
|
|
46
|
-
phantom.exit()
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
var page = require('webpage').create();
|
|
2
|
-
page.viewportSize = { width: 400, height : 400 };
|
|
3
|
-
page.content = '<html><body><canvas id="surface"></canvas></body></html>';
|
|
4
|
-
page.evaluate(function() {
|
|
5
|
-
var el = document.getElementById('surface'),
|
|
6
|
-
context = el.getContext('2d'),
|
|
7
|
-
width = window.innerWidth,
|
|
8
|
-
height = window.innerHeight,
|
|
9
|
-
cx = width / 2,
|
|
10
|
-
cy = height / 2,
|
|
11
|
-
radius = width / 2.3,
|
|
12
|
-
imageData,
|
|
13
|
-
pixels,
|
|
14
|
-
hue, sat, value,
|
|
15
|
-
i = 0, x, y, rx, ry, d,
|
|
16
|
-
f, g, p, u, v, w, rgb;
|
|
17
|
-
|
|
18
|
-
el.width = width;
|
|
19
|
-
el.height = height;
|
|
20
|
-
imageData = context.createImageData(width, height);
|
|
21
|
-
pixels = imageData.data;
|
|
22
|
-
|
|
23
|
-
for (y = 0; y < height; y = y + 1) {
|
|
24
|
-
for (x = 0; x < width; x = x + 1, i = i + 4) {
|
|
25
|
-
rx = x - cx;
|
|
26
|
-
ry = y - cy;
|
|
27
|
-
d = rx * rx + ry * ry;
|
|
28
|
-
if (d < radius * radius) {
|
|
29
|
-
hue = 6 * (Math.atan2(ry, rx) + Math.PI) / (2 * Math.PI);
|
|
30
|
-
sat = Math.sqrt(d) / radius;
|
|
31
|
-
g = Math.floor(hue);
|
|
32
|
-
f = hue - g;
|
|
33
|
-
u = 255 * (1 - sat);
|
|
34
|
-
v = 255 * (1 - sat * f);
|
|
35
|
-
w = 255 * (1 - sat * (1 - f));
|
|
36
|
-
pixels[i] = [255, v, u, u, w, 255, 255][g];
|
|
37
|
-
pixels[i + 1] = [w, 255, 255, v, u, u, w][g];
|
|
38
|
-
pixels[i + 2] = [u, u, w, 255, 255, v, u][g];
|
|
39
|
-
pixels[i + 3] = 255;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
context.putImageData(imageData, 0, 0);
|
|
45
|
-
document.body.style.backgroundColor = 'white';
|
|
46
|
-
document.body.style.margin = '0px';
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
page.render('colorwheel.png');
|
|
50
|
-
|
|
51
|
-
phantom.exit();
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
page = require('webpage').create()
|
|
2
|
-
|
|
3
|
-
page.onInitialized = ->
|
|
4
|
-
page.evaluate ->
|
|
5
|
-
userAgent = window.navigator.userAgent
|
|
6
|
-
platform = window.navigator.platform
|
|
7
|
-
window.navigator =
|
|
8
|
-
appCodeName: 'Mozilla'
|
|
9
|
-
appName: 'Netscape'
|
|
10
|
-
cookieEnabled: false
|
|
11
|
-
sniffed: false
|
|
12
|
-
|
|
13
|
-
window.navigator.__defineGetter__ 'userAgent', ->
|
|
14
|
-
window.navigator.sniffed = true
|
|
15
|
-
userAgent
|
|
16
|
-
|
|
17
|
-
window.navigator.__defineGetter__ 'platform', ->
|
|
18
|
-
window.navigator.sniffed = true
|
|
19
|
-
platform
|
|
20
|
-
|
|
21
|
-
if phantom.args.length is 0
|
|
22
|
-
console.log 'Usage: unsniff.js <some URL>'
|
|
23
|
-
phantom.exit()
|
|
24
|
-
else
|
|
25
|
-
address = phantom.args[0]
|
|
26
|
-
console.log 'Checking ' + address + '...'
|
|
27
|
-
page.open address, (status) ->
|
|
28
|
-
if status isnt 'success'
|
|
29
|
-
console.log 'FAIL to load the address'
|
|
30
|
-
else
|
|
31
|
-
window.setTimeout ->
|
|
32
|
-
sniffed = page.evaluate(->
|
|
33
|
-
navigator.sniffed
|
|
34
|
-
)
|
|
35
|
-
if sniffed
|
|
36
|
-
console.log 'The page tried to sniff the user agent.'
|
|
37
|
-
else
|
|
38
|
-
console.log 'The page did not try to sniff the user agent.'
|
|
39
|
-
phantom.exit()
|
|
40
|
-
, 1500
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Detect if a web page sniffs the user agent or not.
|
|
2
|
-
|
|
3
|
-
var page = require('webpage').create(),
|
|
4
|
-
sniffed,
|
|
5
|
-
address;
|
|
6
|
-
|
|
7
|
-
page.onInitialized = function () {
|
|
8
|
-
page.evaluate(function () {
|
|
9
|
-
|
|
10
|
-
(function () {
|
|
11
|
-
var userAgent = window.navigator.userAgent,
|
|
12
|
-
platform = window.navigator.platform;
|
|
13
|
-
|
|
14
|
-
window.navigator = {
|
|
15
|
-
appCodeName: 'Mozilla',
|
|
16
|
-
appName: 'Netscape',
|
|
17
|
-
cookieEnabled: false,
|
|
18
|
-
sniffed: false
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
window.navigator.__defineGetter__('userAgent', function () {
|
|
22
|
-
window.navigator.sniffed = true;
|
|
23
|
-
return userAgent;
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
window.navigator.__defineGetter__('platform', function () {
|
|
27
|
-
window.navigator.sniffed = true;
|
|
28
|
-
return platform;
|
|
29
|
-
});
|
|
30
|
-
})();
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
if (phantom.args.length === 0) {
|
|
35
|
-
console.log('Usage: unsniff.js <some URL>');
|
|
36
|
-
phantom.exit();
|
|
37
|
-
} else {
|
|
38
|
-
address = phantom.args[0];
|
|
39
|
-
console.log('Checking ' + address + '...');
|
|
40
|
-
page.open(address, function (status) {
|
|
41
|
-
if (status !== 'success') {
|
|
42
|
-
console.log('FAIL to load the address');
|
|
43
|
-
} else {
|
|
44
|
-
window.setTimeout(function () {
|
|
45
|
-
sniffed = page.evaluate(function () {
|
|
46
|
-
return navigator.sniffed;
|
|
47
|
-
});
|
|
48
|
-
if (sniffed) {
|
|
49
|
-
console.log('The page tried to sniff the user agent.');
|
|
50
|
-
} else {
|
|
51
|
-
console.log('The page did not try to sniff the user agent.');
|
|
52
|
-
}
|
|
53
|
-
phantom.exit();
|
|
54
|
-
}, 1500);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Get driving direction using Google Directions API.
|
|
2
|
-
|
|
3
|
-
page = require('webpage').create()
|
|
4
|
-
|
|
5
|
-
if phantom.args.length < 2
|
|
6
|
-
console.log 'Usage: direction.js origin destination'
|
|
7
|
-
console.log 'Example: direction.js "San Diego" "Palo Alto"'
|
|
8
|
-
phantom.exit(1)
|
|
9
|
-
else
|
|
10
|
-
origin = phantom.args[0]
|
|
11
|
-
dest = phantom.args[1]
|
|
12
|
-
page.open encodeURI('http://maps.googleapis.com/maps/api/directions/xml?origin=' + origin +
|
|
13
|
-
'&destination=' + dest + '&units=imperial&mode=driving&sensor=false'),
|
|
14
|
-
(status) ->
|
|
15
|
-
if status isnt 'success'
|
|
16
|
-
console.log 'Unable to access network'
|
|
17
|
-
else
|
|
18
|
-
steps = page.content.match(/<html_instructions>(.*)<\/html_instructions>/ig)
|
|
19
|
-
if not steps
|
|
20
|
-
console.log 'No data available for ' + origin + ' to ' + dest
|
|
21
|
-
else
|
|
22
|
-
for ins in steps
|
|
23
|
-
ins = ins.replace(/\</ig, '<').replace(/\>/ig, '>')
|
|
24
|
-
ins = ins.replace(/\<div/ig, '\n<div')
|
|
25
|
-
ins = ins.replace(/<.*?>/g, '')
|
|
26
|
-
console.log(ins)
|
|
27
|
-
console.log ''
|
|
28
|
-
console.log page.content.match(/<copyrights>.*<\/copyrights>/ig).join('').replace(/<.*?>/g, '')
|
|
29
|
-
phantom.exit()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Get driving direction using Google Directions API.
|
|
2
|
-
|
|
3
|
-
var page = require('webpage').create(),
|
|
4
|
-
origin, dest, steps;
|
|
5
|
-
|
|
6
|
-
if (phantom.args.length < 2) {
|
|
7
|
-
console.log('Usage: direction.js origin destination');
|
|
8
|
-
console.log('Example: direction.js "San Diego" "Palo Alto"');
|
|
9
|
-
phantom.exit(1);
|
|
10
|
-
} else {
|
|
11
|
-
origin = phantom.args[0];
|
|
12
|
-
dest = phantom.args[1];
|
|
13
|
-
page.open(encodeURI('http://maps.googleapis.com/maps/api/directions/xml?origin=' + origin +
|
|
14
|
-
'&destination=' + dest + '&units=imperial&mode=driving&sensor=false'), function (status) {
|
|
15
|
-
if (status !== 'success') {
|
|
16
|
-
console.log('Unable to access network');
|
|
17
|
-
} else {
|
|
18
|
-
steps = page.content.match(/<html_instructions>(.*)<\/html_instructions>/ig);
|
|
19
|
-
if (steps == null) {
|
|
20
|
-
console.log('No data available for ' + origin + ' to ' + dest);
|
|
21
|
-
} else {
|
|
22
|
-
steps.forEach(function (ins) {
|
|
23
|
-
ins = ins.replace(/\</ig, '<').replace(/\>/ig, '>');
|
|
24
|
-
ins = ins.replace(/\<div/ig, '\n<div');
|
|
25
|
-
ins = ins.replace(/<.*?>/g, '');
|
|
26
|
-
console.log(ins);
|
|
27
|
-
});
|
|
28
|
-
console.log('');
|
|
29
|
-
console.log(page.content.match(/<copyrights>.*<\/copyrights>/ig).join('').replace(/<.*?>/g, ''));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
phantom.exit();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# echoToFile.coffee - Write in a given file all the parameters passed on the CLI
|
|
2
|
-
fs = require 'fs'
|
|
3
|
-
|
|
4
|
-
if phantom.args.length < 2
|
|
5
|
-
console.log "Usage: echoToFile.js DESTINATION_FILE <arguments to echo...>"
|
|
6
|
-
phantom.exit()
|
|
7
|
-
else
|
|
8
|
-
content = ""
|
|
9
|
-
f = null
|
|
10
|
-
i = 1
|
|
11
|
-
while i < phantom.args.length
|
|
12
|
-
content += phantom.args[i] + (if i == phantom.args.length - 1 then "" else " ")
|
|
13
|
-
++i
|
|
14
|
-
try
|
|
15
|
-
f = fs.open(phantom.args[0], "w")
|
|
16
|
-
f.writeLine content
|
|
17
|
-
catch e
|
|
18
|
-
console.log e
|
|
19
|
-
phantom.exit()
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// echoToFile.js - Write in a given file all the parameters passed on the CLI
|
|
2
|
-
var fs = require('fs');
|
|
3
|
-
|
|
4
|
-
if (phantom.args.length < 2) {
|
|
5
|
-
console.log("Usage: echoToFile.js DESTINATION_FILE <arguments to echo...>");
|
|
6
|
-
phantom.exit();
|
|
7
|
-
} else {
|
|
8
|
-
var content = '',
|
|
9
|
-
f = null;
|
|
10
|
-
for ( i= 1; i < phantom.args.length; ++i ) {
|
|
11
|
-
content += phantom.args[i] + (i === phantom.args.length-1 ? '' : ' ');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
f = fs.open(phantom.args[0], "w");
|
|
16
|
-
f.writeLine(content);
|
|
17
|
-
} catch (e) {
|
|
18
|
-
console.log(e);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
phantom.exit();
|
|
22
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var feature, supported = [], unsupported = [];
|
|
2
|
-
|
|
3
|
-
phantom.injectJs('modernizr.js');
|
|
4
|
-
console.log('Detected features (using Modernizr ' + Modernizr._version + '):');
|
|
5
|
-
for (feature in Modernizr) {
|
|
6
|
-
if (Modernizr.hasOwnProperty(feature)) {
|
|
7
|
-
if (feature[0] !== '_' && typeof Modernizr[feature] !== 'function' &&
|
|
8
|
-
feature !== 'input' && feature !== 'inputtypes') {
|
|
9
|
-
if (Modernizr[feature]) {
|
|
10
|
-
supported.push(feature);
|
|
11
|
-
} else {
|
|
12
|
-
unsupported.push(feature);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
console.log('');
|
|
19
|
-
console.log('Supported:');
|
|
20
|
-
supported.forEach(function (e) {
|
|
21
|
-
console.log(' ' + e);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
console.log('');
|
|
25
|
-
console.log('Not supported:');
|
|
26
|
-
unsupported.forEach(function (e) {
|
|
27
|
-
console.log(' ' + e);
|
|
28
|
-
});
|
|
29
|
-
phantom.exit();
|
|
30
|
-
|