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
cd2a1a77
...
cd2a1a7728e52a704b5dcd9ceb68642a469e196e
authored
2012-01-15 08:06:22 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed CS CS standards
1 parent
9061eea1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
samples/screenshot.coffee
samples/timeout.coffee
samples/screenshot.coffee
View file @
cd2a1a7
...
...
@@ -7,10 +7,10 @@ casper = require('casper').create
width
:
1024
height
:
768
twitterAccount
=
casper
.
cli
.
get
(
0
)
filename
=
casper
.
cli
.
get
(
1
)
twitterAccount
=
casper
.
cli
.
get
0
filename
=
casper
.
cli
.
get
1
if
not
twitterAccount
or
not
filename
or
not
/\.(png|jpg|pdf)$/i
.
test
(
filename
)
if
not
twitterAccount
or
not
filename
or
not
/\.(png|jpg|pdf)$/i
.
test
filename
casper
.
echo
"Usage $ casperjs samples/screenshot.coffee <twitter-account> <filename.[jpg|png|pdf]>"
casper
.
exit
()
...
...
samples/timeout.coffee
View file @
cd2a1a7
...
...
@@ -19,13 +19,13 @@ casper = require('casper').create
@
echo
'NOPE.'
,
'RED_BAR'
@
exit
()
timeout
=
~~
casper
.
cli
.
get
(
0
);
timeout
=
~~
casper
.
cli
.
get
0
if
timeout
<
1
casper
.
echo
"You must pass a valid timeout value"
casper
.
exit
()
casper
.
echo
"Will google.com load in less than
#{
timeout
}
ms?"
casper
.
options
.
timeout
=
timeout
;
casper
.
options
.
timeout
=
timeout
casper
.
start
'http://www.google.com/'
,
->
@
echo
'YES!'
,
'GREEN_BAR'
...
...
Please
register
or
sign in
to post a comment