-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ts
47 lines (41 loc) · 1.46 KB
/
test.ts
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
import SPN2Client from './index';
import env from './env';
// Create a new instance of SPN2Client
// You can get your ACCESS_KEY and SECRET_KEY from your account on archive.org
// Check here: https://archive.org/account/s3.php
const client = new SPN2Client(env.ACCESS_KEY, env.SECRET_KEY);
(async () => {
await client.savePageNow({
url: 'https://www.npmjs.com/package/spn2',
captureAll: true,
captureOutlinks: true,
captureScreenshot: true,
/*
delayWBAvalability: true,
forceGet: true,
skipFirstArchive: true,
ifNotArchivedWithinBetween: ["1h","5h"],
ifNotArchivedWithin: 1h,
outlinks_availability: true,
emailResults: true,
captureExternalCookies: 'test',
captureExternalUserAgent: 'test',
captureTargetAuthorizations: {
username: 'test',
password: 'test'
}
*/
}).then((res: object) => {
console.log(`client.savePageNow():`,res);
});
await client.savePageNowStatus('spn2-f1500ef4caff2c81b98feff1e3bfcb762255950b').then((res: object) => {
console.log(`client.savePageNowStatus('spn2-f1500e'):`,res);
});
await client.systemStatus().then((res: object) => {
console.log(`client.systemStatus():`,res);
});
await client.userStatus().then((res: object) => {
console.log(`client.userStatus():`,res);
});
})();
//console.log(client.test('https://www.google.com'));