This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OAuth = require('oauth') | |
const async = require('async') | |
const _ = require('lodash') | |
// YOU CAN FIND THIS ON YOUR TWITTER DEVELOPER CONSOLE | |
const CLIENT_ID = 'YOUR TWITTER CONSUMER KEY' | |
const CLIENT_SECRET = 'YOUR TWITTER CONSUMER SECRET' | |
const ACCESS_TOKEN = 'YOUR ACCESS TOKEN' | |
const ACCESS_SECRET = 'YOUR ACCESS SECRET' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios') | |
const cheerio = require('cheerio') | |
const fs = require('fs') | |
function waitUntil(t) { | |
return new Promise(r => { | |
setTimeout(r, t) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer') | |
const scrape = (async () => { | |
const browser = await puppeteer.launch({ headless: false }) | |
const page = await browser.newPage() | |
await page.goto('https://producthunt.com') | |
const product_links = await page.evaluate(() => { | |
const links = Array.from(document.querySelectorAll('a[data-test*="post-name-"]')) |