forked from appatalks/chatgpt-html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
external.js
46 lines (41 loc) · 1.17 KB
/
external.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
// Inital External Data Discovery
// Current Date
const dateFile = "date.data"; // relative path to the file
let dateContents; // create a variable to store the file contents
fetch(dateFile)
.then(response => response.text())
.then(contents => {
dateContents = contents.replace(/\n/g, ''); // store the file contents in the variable
})
// Weather Report
const weatherFile = "weather.data";
let weatherContents;
fetch(weatherFile)
.then(response => response.text())
.then(contents => {
weatherContents = contents.replace(/\n/g, '');
})
// Top Headline News
const newsFile = "news.data";
let newsContents;
fetch(newsFile)
.then(response => response.text())
.then(contents => {
newsContents = contents.replace(/\n/g, '');
})
// Top Market Headlines
const marketFile = "market.data";
let marketContents;
fetch(marketFile)
.then(response => response.text())
.then(contents => {
marketContents = contents.replace(/\n/g, '');
})
// Latest Solar Weather
const solarFile = "solar.data";
let solarContents;
fetch(solarFile)
.then(response => response.text())
.then(contents => {
solarContents = contents.replace(/\n/g, '');
})