<commit_before>/**
 * This script will add a custom HTTP status code handler, here for 404 pages.
 *
 */
var casper = require('casper').create();

casper.on('casper.http.status.200', function(resource) {
    casper.echo(resource.url + ' is OK', 'INFO');
});

casper.on('casper.http.status.301', function(resource) {
    casper.echo(resource.url + ' is permanently redirected', 'PARAMETER');
});

casper.on('casper.http.status.302', function(resource) {
    casper.echo(resource.url + ' is temporarily redirected', 'PARAMETER');
});

casper.on('casper.http.status.404', function(resource) {
    casper.echo(resource.url + ' is not found', 'COMMENT');
});

casper.on('casper.http.status.500', function(resource) {
    casper.echo(resource.url + ' is in error', 'ERROR');
});

var links = [
    'http://google.com/',
    'http://www.google.com/',
    'http://www.google.com/plop'
];

casper.start().each(links, function(self, link) {
    self.thenOpen(link, function() {
        this.echo(link + ' loaded');
    });
});

casper.run();<commit_msg>fixed events.js sample using wrong event names<commit_after>/**
 * 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) {
    casper.echo(resource.url + ' is OK', 'INFO');
});

casper.on('http.status.301', function(resource) {
    casper.echo(resource.url + ' is permanently redirected', 'PARAMETER');
});

casper.on('http.status.302', function(resource) {
    casper.echo(resource.url + ' is temporarily redirected', 'PARAMETER');
});

casper.on('http.status.404', function(resource) {
    casper.echo(resource.url + ' is not found', 'COMMENT');
});

casper.on('http.status.500', function(resource) {
    casper.echo(resource.url + ' is in error', 'ERROR');
});

var links = [
    'http://google.com/',
    'http://www.google.com/',
    'http://www.google.com/plop'
];

casper.start().each(links, function(self, link) {
    self.thenOpen(link, function() {
        this.echo(link + ' loaded');
    });
});

casper.run();
{'fraction_non_alphanumeric': 0.19769673704414586, 'fraction_numerical': 0.01727447216890595, 'mean_word_length': 3.9524940617577196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7415557', 'n_tokens_mistral': 724, 'n_tokens_neox': 705, 'n_words': 135}