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
var _global = typeof window === 'object' && window.window === window | |
? window : typeof self === 'object' && self.self === self | |
? self : typeof global === 'object' && global.global === global | |
? global | |
: this | |
function bom (blob, opts) { | |
if (typeof opts === 'undefined') opts = { autoBom: false } | |
else if (typeof opts !== 'object') { | |
console.warn('Deprecated: Expected third argument to be a object') |
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
function getResults(pageNum=0) { | |
return fetch("https://api.dealroom.co/api/v2/companies?cashbust=1624537538583&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhcHAuZGVhbHJvb20uY28iLCJpc3MiOiJkZWFscm9vbS5jbyIsImlhdCI6MTYyNDQ1ODUwMCwiZXhwIjoxNjI3MDUwNTAwLCJuYmYiOjE2MjQ0NTg1MDAsInVzZXJJZCI6MzAyNDI3MX0.-pMZ6X0sHhb9hA6JQdAnYHgy29d9YEHG3S-OyuZfSIc", { | |
"headers": { | |
"accept": "*/*", | |
"accept-language": "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7", | |
"content-type": "application/json", | |
"sec-ch-ua": "\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"", | |
"sec-ch-ua-mobile": "?0", | |
"sec-fetch-dest": "empty", | |
"sec-fetch-mode": "cors", |
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 {BrowserWindow, protocol} = require('electron'); | |
const authService = require('../services/auth-service'); | |
const createAppWindow = require('../main/app-process'); | |
let win = null; | |
function createAuthWindow() { | |
destroyAuthWin(); | |
// Create the browser window. |
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
function addLinksToImages(links=[]) { | |
let images = Array.from( | |
document.querySelectorAll("div[class='owl-item active'] div[id*=ishitopbanners_] img") | |
); | |
images.forEach( | |
(img,index) => { | |
const link = links[index] || "https://www.need-sun.fr/fr/4-robes"; | |
img.outerHTML = `<a href="${link}">${img.outerHTML}</a>`; | |
} | |
); |
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
function isSmaller(limit) { | |
return number => number < limit; | |
} | |
function filterArray(listOfNumbers, limit) { | |
return listOfNumbers.filter(isSmaller(limit)); | |
} | |
let numbers = [10, 9, 8, 2, 7, 5, 1, 3, 0]; |
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 browser = puppeteer.launch(); | |
const scrapeMedium = async () => { | |
await browser; | |
const page = await browser.newPage(); | |
await page.goto('https://medium.com/search?q=headless%20browser'); | |
const scrapedData = await page.evaluate(() => | |
Array.from(document.querySelectorAll('div.postArticle-content a:first-child[data-action-value]')) |
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
$ mkdir thal | |
$ cd thal | |
$ npm init | |
$ npm i --save puppeteer |