-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
40 lines (35 loc) · 1.29 KB
/
test.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
const { searchAll } = require('./lib/search');
const { getFromRoomId, getFromRoomUrl } = require('./lib/details')
// const fs = require('fs').promises;
async function test0() {
const roomId = "https://www.airbnb.co.uk/rooms/20669368";
const currency = "MXN";
const checkIn = "2024-11-02";
const checkOut = "2024-11-10";
const data = await getFromRoomUrl(roomId, currency, checkIn, checkOut, "");
// await fs.writeFile("details.json", JSON.stringify(data, null, 2));
}
async function test1() {
const roomId = 33571268;
const currency = "MXN";
const checkIn = "2024-11-02";
const checkOut = "2024-11-10";
const data = await getFromRoomId(roomId, currency, checkIn, checkOut, "");
// await fs.writeFile("details.json", JSON.stringify(data, null, 2));
}
async function test2() {
const currency = "MXN";
const checkIn = "2024-11-02";
const checkOut = "2024-11-10";
const neLat = -1.03866277790021;
const neLong = -77.53091734683608;
const swLat = -1.1225978433925647;
const swLong = -77.59713412765507;
const zoomValue = 2;
const results = await searchAll(checkIn, checkOut, neLat, neLong, swLat, swLong, zoomValue, currency, "");
// await fs.writeFile("search.json", JSON.stringify(results, null, 2));
}
async function main() {
await test0();
}
main().catch(console.error);