Skip to content

Instantly share code, notes, and snippets.

View tomer-yoskovich's full-sized avatar

Tomer Yoskovich tomer-yoskovich

  • Israel
View GitHub Profile
# comment 1
mkdir myFolder
cd myFolder
# initialize new project (creates package.json).
# "-f" means to accept defaults for package name, author, etc.
npm init -f
# Installs puppeteer and a compatible version of Chromium. ~100mb download
npm install puppeteer
const puppeteer = require('puppeteer');
// IIFE async pattern (more below)
(async () => {
// opens the chromium browser
const browser = await puppeteer.launch({
headless: false, // when debugging we prefer seeing the browser in action
slowMo: 250 // slow down puppeteer actions so we can see what's going on (in ms)
});
function whatsAppClickEnter() {
osascript -e 'activate application "WhatsApp"' -e 'tell application "System Events" to key code 36'
}
function sendWhatsappMessage() {
open -a WhatsApp https://wa.me/"$1"\?text\="$2"
whatsAppClickEnter
sleep 0.2
}
Creation of gists from clipboard contents
get_github_token
int(os.environ
https://gist.github.com/de05a48690a2f135a187cf704b791370
open -a WhatsApp https://wa.me/<CountryCode><PhoneNumber>?text=Hello
osascript -e 'activate application "WhatsApp"' -e 'tell application "System Events" to key code 36'
sendWhatsappMessage 972547123456 "hello there!"