Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
d7d236bd
...
d7d236bdf46dc17f086c92ae10b2d841d54d7bd5
authored
2011-12-18 12:20:07 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated samples/googlematch.js to use the new casperjs executable
1 parent
11c2f674
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
samples/googlematch.js
samples/googlematch.js
View file @
d7d236b
...
...
@@ -3,14 +3,12 @@
* estimated results each have.
*
* Usage:
* $
phantom
js samples/googlematch.js nicolas chuck borris
* $
casper
js samples/googlematch.js nicolas chuck borris
* nicolas: 69600000
* chuck: 49500000
* borris: 2370000
* winner is "nicolas" with 69600000 results
*/
phantom
.
injectJs
(
'casper.js'
);
phantom
.
Casper
.
extend
({
fetchScore
:
function
()
{
return
this
.
evaluate
(
function
()
{
...
...
@@ -22,12 +20,14 @@ phantom.Casper.extend({
var
casper
=
new
phantom
.
Casper
({
verbose
:
true
}),
terms
=
phantom
.
args
,
scores
=
[],
i
=
0
;
}),
terms
=
phantom
.
casperArgs
.
args
,
scores
=
[],
i
=
0
;
if
(
terms
.
length
<
2
)
{
casper
.
log
(
'usage: phantom
js googlematch.js term1, term2 [, term3]...'
).
exit
();
casper
.
echo
(
'Usage: casper
js googlematch.js term1, term2 [, term3]...'
).
exit
();
}
casper
.
echo
(
'Let the match begin!'
);
casper
.
start
(
"http://google.fr/"
);
casper
.
each
(
terms
,
function
(
self
,
term
,
i
)
{
...
...
Please
register
or
sign in
to post a comment