Skip to content

Instantly share code, notes, and snippets.

View hhkaos's full-sized avatar
🏠
Working from home

Raul Jimenez Ortega hhkaos

🏠
Working from home
View GitHub Profile
@hhkaos
hhkaos / demo.js
Created February 11, 2023 06:47 — forked from aslushnikov/demo.js
service worker network throttling with pptr
const puppeteer = require('puppeteer');
(async() => {
// Step 1: launch browser and open a new page.
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Step 2: PPTR.DEV has a service worker \m/
// Go there and wait for SW to register.
await page.goto('https://pptr.dev/');
// This code requires that you set the ID of the tweet that you want to Like as an input variable called "tweet_id". Learn more at https://zapier.com/help/code/#data-variables
// INSTUCTIONS FOR SETTING THESE REQUIRED VARIABLES: After you create a new app at https://apps.twitter.com/, click on the name of the app to open it. Then, select the "Keys and Access Tokens" tab.
var twitterApplicationConsumerKey = ''; // Located in the "Application Settings" section
var twitterApplicationConsumerSecret = ''; // Located in the "Application Settings" section
var twitterApplicationAccessToken = ''; // Located in the "Your Access Token" section
var twitterApplicationAccessTokenSecret = ''; // Located in the "Your Access Token" section