Some changes

- Added embeds to homepage to show off my kewlness
- Fixed an issue where my Medal clips would throw a hissy fit about not being in an async function, therefore not loading
This commit is contained in:
awex
2021-06-04 06:35:38 -04:00
parent e79f7e4435
commit 99bbf5adf1
2 changed files with 17 additions and 13 deletions
+7 -8
View File
@@ -5,13 +5,12 @@
const medalapi = 'https://developers.medal.tv/v1/latest?userId=215577&limit=1'
async function medalClips() {
window.addEventListener('load', function () {
const { contentObjects } = await fetch(medalapi, {
method: 'GET',
headers: { 'Authorization': 'pub_x9mjeQnqk07tEK1ge7w2xHYxTpTEbKwN', 'Content-Type': 'application/json' }
}).then(response => response.json())
async function loadClip() {
const { contentObjects } = await fetch(medalapi, {
method: 'GET',
headers: { 'Authorization': 'pub_x9mjeQnqk07tEK1ge7w2xHYxTpTEbKwN', 'Content-Type': 'application/json' }
}).then(response => response.json())
document.querySelector("#clip").innerHTML = contentObjects[0].embedIframeCode
})
document.querySelector("#clip").innerHTML = contentObjects[0].embedIframeCode
document.querySelector("#title").innerHTML = "<i>" + contentObjects[0].contentTitle + "</i>"
}