Skip to content

Instantly share code, notes, and snippets.

View mpr1255's full-sized avatar

matthew p robertson mpr1255

View GitHub Profile
@mpr1255
mpr1255 / make_google_alert.js
Created November 4, 2021 05:24
make google alerts
// consult here for the explanation, but this is a fixed version based on https://dev.to/frenchcooc/how-to-create-a-bunch-of-google-alerts-in-3-minutes-54n
// it has a standard 3 second pause or whatever not some exponential thing that was breaking the code.
// also implemented the explanation in the comment section
function sleep(milliseconds) {
const date = Date.now();
let currentDate = null;
do {
currentDate = Date.now();
} while (currentDate - date < milliseconds);