gologin 1.0.44 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/example-startremote.js +25 -0
- package/examples/example-stopremote.js +20 -0
- package/gologin.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Usage example: in the terminal enter
|
|
2
|
+
// node example-startremote.js yU0token yU0Pr0f1leiD
|
|
3
|
+
|
|
4
|
+
// your token api (located in the settings, api)
|
|
5
|
+
// https://github.com/gologinapp/gologin#usage
|
|
6
|
+
const GOLOGIN_API_TOKEN = process.argv[2];
|
|
7
|
+
// your profile id
|
|
8
|
+
const GOLOGIN_PROFILE_ID = process.argv[3];
|
|
9
|
+
|
|
10
|
+
const GoLogin = require('../gologin');
|
|
11
|
+
|
|
12
|
+
(async () =>{
|
|
13
|
+
const GL = new GoLogin({
|
|
14
|
+
token: GOLOGIN_API_TOKEN,
|
|
15
|
+
profile_id: GOLOGIN_PROFILE_ID,
|
|
16
|
+
});
|
|
17
|
+
// connection of the remote work method
|
|
18
|
+
const {status, wsUrl} = await GL.startRemote();
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
GOLOGIN_PROFILE_CLOUD_URL = wsUrl.split('/')[2]
|
|
22
|
+
console.log('Done! Launch web browser and navigate to URL:', GOLOGIN_PROFILE_CLOUD_URL);
|
|
23
|
+
})();
|
|
24
|
+
|
|
25
|
+
// after running the script, the url will appear on the terminal
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Usage example: in the terminal enter
|
|
2
|
+
// node example-stopremote.js yU0token yU0Pr0f1leiD
|
|
3
|
+
|
|
4
|
+
// your token api (located in the settings, api)
|
|
5
|
+
// https://github.com/gologinapp/gologin#usage
|
|
6
|
+
const GOLOGIN_API_TOKEN = process.argv[2];
|
|
7
|
+
// your profile id
|
|
8
|
+
const GOLOGIN_PROFILE_ID = process.argv[3];
|
|
9
|
+
|
|
10
|
+
const GoLogin = require('../gologin');
|
|
11
|
+
|
|
12
|
+
(async () =>{
|
|
13
|
+
const GL = new GoLogin({
|
|
14
|
+
token: GOLOGIN_API_TOKEN,
|
|
15
|
+
profile_id: GOLOGIN_PROFILE_ID,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// stop profile
|
|
19
|
+
await GL.stopRemote();
|
|
20
|
+
})();
|
package/gologin.js
CHANGED