forked from freshlogic/meh-dash-button
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (27 loc) · 821 Bytes
/
app.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
const Nightmare = require('nightmare');
var session = process.env.MEHSESSION;
var site = 'https://meh.com';
function buttonClicker(){
console.log('go and click');
new Nightmare()
//.goto(site)
.cookies.set({
url: "https://meh.com",
name: "session.meh.com",
value: session
})
.goto(site)
.wait('.meh-button button')
.screenshot('10.png')
.click('.meh-button button')
.screenshot('20.png')
.run(function(err, nightmare) {
if (err) {
return console.log(err);
process.exit(1);
}
console.log('meh button clicked');
process.exit();
});
};
buttonClicker();