-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
60 lines (45 loc) · 2.05 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require('dotenv').config();
const puppeteer = require('puppeteer');
const EMAIL = process.env.FACEBOOK_EMAIL;
const PASSWORD = process.env.FACEBOOK_PASSWORD;
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.setViewport({ width: 1280, height: 720 });
await page.goto('https://www.messenger.com/', { waitUntil: 'networkidle2' });
let emailField = await page.$('[name=email]');
let passwordField = await page.$('[name=pass]');
let submitButton = await page.$('button');
await emailField.type(EMAIL);
await passwordField.type(PASSWORD);
// Wait til submit button is clicked and the page is loaded
const navigationPromise = page.waitForNavigation();
await submitButton.click();
// End Wait
await navigationPromise;
// Your Fucking Messenger Receipient URL
const MESSENGER_URL = 'https://www.messenger.com/t/199901607012936/';
await page.goto(MESSENGER_URL, { waitUntil: 'networkidle2' });
/*********************************************************************
* SPAM CHANGE GROUP AVATAR *
*********************************************************************/
// const pictures = ['./sticker.png', './sticker2.jpg', './sticker3.png']
// setInterval(async () => {
// const elementsHandle = await page.$('input[type=file]');
// for (let picture of pictures) {
// await elementsHandle.uploadFile(picture);
// }
// }, 1000);
/*********************************************************************
* SPAM MESSAGE *
*********************************************************************/
setInterval( async () => {
page.type('._1p1t', 'DEMO :D')
.then(() => {
page.keyboard.press('Enter');
})
.catch((e) => {
console.log("Just to quickly!!! But it's still running!");
});
}, 1000);
})();