Skip to content

Instantly share code, notes, and snippets.

const proxies = {
'useragent1': 'http://proxyusername1:proxypassword1@proxyhost1:proxyport1',
'useragent2': 'http://proxyusername2:proxypassword2@proxyhost2:proxyport2',
'useragent3': 'http://proxyusername3:proxypassword3@proxyhost3:proxyport3',
};
const server = new ProxyChain.Server({
port: 8000,
prepareRequestFunction: ({request}) => {
const userAgent = request.headers['user-agent'];
const blockedResourceTypes = [
'image',
'media',
'font',
'texttrack',
'object',
'beacon',
'csp_report',
'imageset',
];
const blockedResourceTypes = [
'image',
'media',
'font',
'texttrack',
'object',
'beacon',
'csp_report',
'imageset',
// with browserless
browser = await puppeteer.connect({
browserWSEndpoint:
'ws://' +
browserless.ip +
':' +
browserless.port +
'?TOKEN=' +
browserless.token +
'&--proxy-server=' + proxy +
docker pull browserless/chrome
docker run -p 3000:3000 -e "MAX_CONCURRENT_SESSIONS=5"
-e "MAX_QUEUE_LENGTH=0"
-e "PREBOOT_CHROME=true"
-e "TOKEN=YOURTOKEN"
-e "ENABLE_DEBUGGER=false"
-e "CONNECTION_TIMEOUT=300000" --restart always browserless/chrome
Russian Pipeline. Upvote so that this is the first image people see when they Google “Russian Pipeline”
John F. Kennedy Jr. Sitting in the pilot seat of the Marine One circa 1963
I didn't take it as a compliment.
How beautiful is this
Hustle like Faye
The power of a salt water crocodile's tail.
I'm 36, and will be dead inside of a year.
F***ing genius.
TIL Anthony Daniels, who endured years of discomfort in the C-3PO costume, was so annoyed by Alan Tudyk (Rogue One) playing K-2SO in the comfort of a motion-capture suit that he cursed at Tudyk. Tudyk later joked that a "fuck you" from Daniels was among the highest compliments he had ever received.
Reminder about the fact UC Davis paid over $100k to remove this photo from the internet.
const puppeteer = require('puppeteer');
const $ = require('cheerio');
const url = 'https://www.reddit.com';
puppeteer
.launch()
.then(function(browser) {
return browser.newPage();
})
.then(function(page) {
<!DOCTYPE html><html lang="en"><head><link
href="//c.amazon-adsystem.com/aax2/apstag.js" rel="preload"
as="script">
...
const puppeteer = require('puppeteer');
const url = 'https://www.reddit.com';
puppeteer
.launch()
.then(function(browser) {
return browser.newPage();
})
.then(function(page) {
return page.goto(url).then(function() {
<!DOCTYPE html><html
lang="en"><head><title>reddit: the front page of the
internet</title>
...