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
68b32572
...
68b3257281d7ca4fddd36d429cd4346b65fad1cb
authored
2012-12-09 15:40:47 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added jshint directives to samples
1 parent
443a2647
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
72 additions
and
12 deletions
samples/bbcshots.js
samples/cliplay.js
samples/customevents.js
samples/customlogging.js
samples/download.js
samples/dynamic.js
samples/each.js
samples/events.js
samples/extends.js
samples/googlelinks.js
samples/googlematch.js
samples/googlepagination.js
samples/googletesting.js
samples/logcolor.js
samples/metaextract.js
samples/multirun.js
samples/screenshot.js
samples/statushandlers.js
samples/steptimeout.js
samples/timeout.js
samples/translate.js
samples/bbcshots.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* Create a mosaic image from all headline photos on BBC homepage
*/
var
casper
=
require
(
"casper"
).
create
();
var
nbLinks
=
0
;
var
currentLink
=
1
;
...
...
samples/cliplay.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
();
var
dump
=
require
(
"utils"
).
dump
;
...
...
samples/customevents.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
();
// listening to a custom event
...
...
samples/customlogging.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* A basic custom logging implementation. The idea is to (extremely) verbosely
* log every received resource.
*/
...
...
samples/download.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* download the google logo image onto the local filesystem
*/
...
...
samples/dynamic.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
({
verbose
:
true
});
...
...
samples/each.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
();
var
links
=
[
...
...
samples/events.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* This script will add a custom HTTP status code handler, here for 404 pages.
*/
var
casper
=
require
(
"casper"
).
create
();
casper
.
on
(
"http.status.200"
,
function
(
resource
)
{
...
...
samples/extends.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
({
loadImages
:
false
,
logLevel
:
"debug"
,
...
...
@@ -34,4 +37,4 @@ Object.keys(links).forEach(function(url) {
fantomas
.
run
(
function
()
{
this
.
renderJSON
(
links
);
this
.
exit
();
});
\ No newline at end of file
});
...
...
samples/googlelinks.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
links
=
[];
var
casper
=
require
(
"casper"
).
create
();
...
...
samples/googlematch.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* Takes provided terms passed as arguments and query google for the number of
* estimated results each have.
*
...
...
samples/googlepagination.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* Capture multiple pages of google search results
*
* Usage: $ casperjs googlepagination.coffee my search terms
...
...
samples/googletesting.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
({
logLevel
:
"debug"
});
...
...
samples/logcolor.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
({
verbose
:
true
,
logLevel
:
"debug"
...
...
samples/metaextract.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
();
var
url
=
casper
.
cli
.
get
(
0
);
var
metas
=
[];
...
...
samples/multirun.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
casper
=
require
(
"casper"
).
create
({
verbose
:
true
});
...
...
samples/screenshot.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* This script will capture a screenshot of a twitter account page
* Usage: $ casperjs screenshot.coffee <twitter-account> <filename.[jpg|png|pdf]>
*/
...
...
samples/statushandlers.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* This script will add a custom HTTP status code handler, here for 404 pages.
*/
...
...
samples/steptimeout.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
var
failed
=
[];
var
start
=
null
;
var
links
=
[
...
...
samples/timeout.js
View file @
68b3257
/*
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* Just a silly game.
*
* $ casperjs samples/timeout.js 500
...
...
samples/translate.js
View file @
68b3257
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* Translation using the Google Translate Service.
*
...
...
Please
register
or
sign in
to post a comment