Commit 3ffc42fa 3ffc42fa87dfb9fc14ebd24675b0a1e474cf7f76 by Nicolas Perriault

fixed CS CS standards & typos in samples

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