-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetter.js
More file actions
31 lines (26 loc) · 685 Bytes
/
getter.js
File metadata and controls
31 lines (26 loc) · 685 Bytes
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
import { get } from 'https://kittenapps-films.github.io/edit/code.js'
import { Octokit } from "https://esm.sh/@octokit/core";
export async function getContents() {
const octokit = new Octokit({
auth: get(),
})
var oldfile = await octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
owner: 'KittenApps-Films',
repo: 'GeoFS_Wiki',
path: 'GeoFSUsers.js',
headers: {
'X-GitHub-Api-Version': '2022-11-28',
'Accept' : 'application/vnd.github.raw+json'
}
})
function getter(data) {
var b = data.slice(19)
console.log(b);
var c = JSON.parse(b)
console.log(c);
return c
}
var filecontents = getter(oldfile.data)
return filecontents
}
getContents()