-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (40 loc) · 1.51 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Config Updater</title>
</head>
<body>
<h1>Config Updater</h1>
<label for="configInput">Enter Configuration Value:</label>
<input type="text" id="configInput" placeholder="Enter value">
<button onclick="updateConfig()">Update Config</button>
<script>
function updateConfig() {
var inputValue = document.getElementById("configInput").value;
// Update your configuration file (config.json) with the new value
fetch('https://api.github.com/repos/gmondello/fubar/config.json', {
method: 'PUT',
headers: {
'Authorization': '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',
'Accept': 'application/vnd.github.v3+json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
message: 'Update config.json',
content: btoa(JSON.stringify({ value: inputValue })),
sha: '695c47bf7bf398d55f3aa81e148330570532799b',
}),
})
.then(response => response.json())
.then(data => {
console.log('Config updated successfully:', data);
})
.catch(error => {
console.error('Error updating config:', error);
});
}
</script>
</body>
</html>