-
Notifications
You must be signed in to change notification settings - Fork 1
/
unlock-form.js
69 lines (59 loc) · 1.42 KB
/
unlock-form.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
60
61
62
63
64
65
66
67
68
69
'use strict'
const rp = require('request-promise')
const keys = [
{
type: "FORM",
url: "https://target-website.com/login",
form: {
value: {
user_id: "your-id",
password: "your-password"
},
selector: {
user_id: "input#user-id",
password: "input#password",
submit: "button[type=\"submit\"]"
}
}
}
]
const scene = {
url: 'https://target-website.com',
selector: 'body',
dom_index: 0,
viewport: {width: 900, height: 700}
}
const storage = {
type: 'gcs',
project_id: 'your_project_id',
bucket: 'your_bucket',
credentials: {
client_email: '[email protected]',
private_key: '-----YOUR PRIVATE KEY STRING -----'
},
path: 'test/folder',
how_long: {
unit: 'years', // units from here https://momentjs.com/docs/#/get-set/set/
period: 2
}
}
const markets = [{
type: 'slack',
webhook_url: 'https://hooks.slack.com/services/your/webhook/url',
title: 'title',
text: 'text',
footer: 'footer'
}]
const body = { markets, storage, scene, keys }
(async () => {
const host = 'http://scene-stealer.server:port' // replace with your scene-stealer server/container url
const options = {
method: 'POST',
uri: `${host}/take`,
body,
json: true
}
const result = await rp(options)
console.log(result)
// and check your slack channel if the message has arrived with the screenshot
})()