Skip to content

Instantly share code, notes, and snippets.

View boogheta's full-sized avatar

Benjamin Ooghe-Tabanou boogheta

View GitHub Profile
@boogheta
boogheta / sandcrawler-test.js
Created December 9, 2014 16:40
Tryouts with sandcrawler on Libération's articles tagged with "sexe"
var sandcrawler = require("sandcrawler"),
//artoo = require("sandcrawler/node_modules/artoo-js"),
artoo = require("artoo-js"),
logger = require("sandcrawler-logger"),
fs = require("fs"),
data = [];
// Declare a plugin
var throttle = function(opts) {
return function(scraper) {
@boogheta
boogheta / scrolldown_and_unfold.js
Created August 11, 2014 15:02
Scroll and unfold a webpage within PhantomJS or artoo.js
// Handle script with no argument for DEBUG as an artoo bookmarklet
if (typeof(arguments) == "undefined") {
arguments = [60, 20, 15, function(){console.log("FINISHED!");}];
}
(function(endScript, timeout, idle_timeout, ajax_timeout) {
var timeout = Math.max(30, timeout) * 1000,
idle_timeout = idle_timeout * 1000,
ajax_timeout = ajax_timeout * 1000;
class Bash(object):
@property
def out(self):
return self._wrapped
def __mod__(self, other):
self._wrapped = other
return self