apt-get update
apt-get upgrade
apt-get install build-essential
var buttons = $('div[role=dialog]').find('button:contains(Follow)').filter(function() { | |
return $(this).text().toLowerCase() === 'follow'; | |
}); | |
$.each(buttons, function(idx, itm) { | |
var secondes = Math.floor((Math.random() * 10) + 3); | |
setTimeout(function() { | |
$(itm).trigger('click'); | |
}, duration = secondes * 1000); |
# -*- coding: utf-8 -*- | |
# MIT License (c) Lhassan Baazzi <baazzilhassan@gmail.com> | |
from collections import defaultdict | |
from twisted.internet import reactor | |
from scrapy import signals | |
class CloseSpider(object): | |
def __init__(self, crawler): |
fgrep -vf /path/to/file1 /path/to/file2 |
In this Gist will show you how to get parents of a list of child from an Oracle database.
Let's start with the table below:
Child | Parent |
---|---|
1 | NULL |
2 | 1 |
3 | 2 |
4 | 3 |
Create a scrapy exporter on the root of your scrapy project, we suppose the name of your project is my_project
, we can name this exporter: my_project_csv_item_exporter.py
from scrapy.conf import settings
from scrapy.contrib.exporter import CsvItemExporter
class MyProjectCsvItemExporter(CsvItemExporter):
def __init__(self, *args, **kwargs):
delimiter = settings.get('CSV_DELIMITER', ',')
-- Table that store hotels reviews | |
CREATE TABLE hotels_reviews ( | |
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | |
review TEXT NOT NULL | |
); | |
-- As SQLite index content on a virtual table, | |
-- We need to create a virtual table for hotels_reviews | |
-- I use the last extension fts5 for full text searching https://www.sqlite.org/fts5.html | |
-- I use the "porter" tokenizer, check this link for definition: https://www.sqlite.org/fts3.html#tokenizer |
;(function(global, $) { | |
/**** PARAMETERS BLOCK ************************/ | |
var miniFollowersToIgnore = 0, | |
miniFollowingToKeep = 1000, | |
secondes = Math.floor((Math.random() * 10) + 10), | |
enableBioFilter = false, | |
userBioKeywords = [ | |
'devel', 'code', 'analysis', | |
'cloud', 'unix', 'tech', 'computer', | |
'.net', 'freelance', 'guru', 'UX', |