From 910cdc3442e41ebee80264bee05ba64f6a23e98b Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 5 Mar 2022 10:49:17 +0100 Subject: Remove debug --- init.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'init.js') diff --git a/init.js b/init.js index d8ac681..e806ba0 100644 --- a/init.js +++ b/init.js @@ -2,13 +2,8 @@ const fetch = require("node-fetch") const cheerio = require("cheerio") const jsonic = require("jsonic") -const debug = arg => { - console.log(arg) - return arg -} - module.exports.search = (query, userAgent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0") => - fetch("https://www.google.com/search?tbm=isch&q=" + encodeURIComponent(debug(query)), {headers: {"User-Agent": userAgent}}).then(res => res.text()).then(data => + fetch("https://www.google.com/search?tbm=isch&q=" + encodeURIComponent(query), {headers: {"User-Agent": userAgent}}).then(res => res.text()).then(data => cheerio.load(data, null, false) // parse HTML ("script") // find script tags .toArray() // convert cheerio list to array -- cgit v1.2.3