Commit 3ffc42fa 3ffc42fa87dfb9fc14ebd24675b0a1e474cf7f76 by Nicolas Perriault

fixed CS CS standards & typos in samples

2 parents cd2a1a77 49594d97
......@@ -2,7 +2,7 @@ branches:
only:
- master
before_script:
- "export PHANTOMJS_EXECUTABLE='phantomjs'"
- "export PHANTOMJS_EXECUTABLE='phantomjs --local-to-remote-url-access=yes --ignore-ssl-errors=yes'"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
......
# download the google logo image as base64
### download the google logo image as base64 ###
casper = require('casper').create verbose: true
......
......@@ -12,6 +12,4 @@ casper.start().each(links, function(self, link) {
});
});
casper.run(function(self) {
self.exit();
});
casper.run();
......
casper = require('casper').create()
casper.on "http.status.200", (resource) ->
casper.echo "#{resource.url} is OK", "INFO"
@echo "#{resource.url} is OK", "INFO"
casper.on "http.status.301", (resource) ->
casper.echo "#{resource.url} is permanently redirected", "PARAMETER"
@echo "#{resource.url} is permanently redirected", "PARAMETER"
casper.on "http.status.302", (resource) ->
casper.echo "#{resource.url} is temporarily redirected", "PARAMETER"
@echo "#{resource.url} is temporarily redirected", "PARAMETER"
casper.on "http.status.404", (resource) ->
casper.echo "#{resource.url} is not found", "COMMENT"
@echo "#{resource.url} is not found", "COMMENT"
casper.on "http.status.500", (resource) ->
casper.echo "#{resource.url} is in error", "ERROR"
@echo "#{resource.url} is in error", "ERROR"
links = [
'http://google.com/'
......
......@@ -5,23 +5,23 @@
var casper = require('casper').create();
casper.on('http.status.200', function(resource) {
casper.echo(resource.url + ' is OK', 'INFO');
this.echo(resource.url + ' is OK', 'INFO');
});
casper.on('http.status.301', function(resource) {
casper.echo(resource.url + ' is permanently redirected', 'PARAMETER');
this.echo(resource.url + ' is permanently redirected', 'PARAMETER');
});
casper.on('http.status.302', function(resource) {
casper.echo(resource.url + ' is temporarily redirected', 'PARAMETER');
this.echo(resource.url + ' is temporarily redirected', 'PARAMETER');
});
casper.on('http.status.404', function(resource) {
casper.echo(resource.url + ' is not found', 'COMMENT');
this.echo(resource.url + ' is not found', 'COMMENT');
});
casper.on('http.status.500', function(resource) {
casper.echo(resource.url + ' is in error', 'ERROR');
this.echo(resource.url + ' is in error', 'ERROR');
});
var links = [
......
### This script will capture a screenshot of a twitter account page
Usage $ casperjs screenshot.coffee <twitter-account>
Usage $ casperjs screenshot.coffee <twitter-account> <filename.[jpg|png|pdf]>
###
casper = require('casper').create
viewportSize:
......
/**
* This script will capture a screenshot of a twitter account page
*
* Usage $ casperjs screenshot.coffee <twitter-account>
* Usage $ casperjs screenshot.coffee <twitter-account> <filename.[jpg|png|pdf]>
*/
var casper = require('casper').create({
viewportSize: {
......