new website lulz
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
async function sendContact() {
|
||||
var email = document.getElementById("email").value;
|
||||
var subject = document.getElementById("subject").value;
|
||||
var message = document.getElementById("message").value;
|
||||
|
||||
// Start of checks
|
||||
|
||||
if(!email || !message || !subject) {
|
||||
document.getElementById('notification').innerHTML = `<p>Sorry, a field wasn't provided!</p>`
|
||||
} else {
|
||||
const data = {
|
||||
"username": "Site Contact",
|
||||
"content": "Someone sent a request from the website contact page!",
|
||||
"embeds": [
|
||||
{
|
||||
"author": {
|
||||
"name": email,
|
||||
"url": "https://awexxx.xyz"
|
||||
},
|
||||
"title": subject,
|
||||
"description": message
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
await fetch(`https://api.awexxx.xyz/website/webhook`, {
|
||||
method: 'POST',
|
||||
headers: { 'content-type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
.then(function(response) {
|
||||
if(response.status === 204) {
|
||||
document.getElementById(`notification`).innerHTML = `<p style="color:azure;">Success! That message was successfully sent!</p>`
|
||||
} else if (response.status === 500) {
|
||||
document.getElementById(`notification`).innerHTML = `<p style="color:red;">Uh oh! Something went wrong sending that message.</p>`
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
///////////////////////////////////
|
||||
// Fetch Script for Awex Clips //
|
||||
// Medal.tv API //
|
||||
///////////////////////////////////
|
||||
|
||||
async function medalclips() {
|
||||
const medalapi = 'https://developers.medal.tv/v1/latest?userId=215577&limit=1'
|
||||
const { contentObjects } = await fetch(medalapi, {
|
||||
method: 'GET',
|
||||
headers: { 'Authorization': 'pub_94FdmA2SMLm6V53dDykcPB3v4HLak6Db', 'Content-Type': 'application/json' }
|
||||
}).then(response => response.json())
|
||||
|
||||
document.querySelector("#clip").innerHTML = contentObjects[0].embedIframeCode
|
||||
document.querySelector("#title").innerHTML = "<i>Clip Title: " + contentObjects[0].contentTitle + "</i>"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
async function getMedalClip() {
|
||||
var clip = await fetch(`https://developers.medal.tv/v1/latest?userId=215577&limit=2`, {
|
||||
method: 'GET',
|
||||
headers: { 'content-type': 'application/json', 'authorization': 'pub_HJcYn9DsxH0iW0N8iCqLPUddAr7hiyo2' }
|
||||
}).then (response => response.json());
|
||||
|
||||
document.querySelector('.c1iframe').innerHTML = clip.contentObjects[0].embedIframeCode
|
||||
document.querySelector('.c1title').innerHTML = `<p>${clip.contentObjects[0].contentTitle}</p>`
|
||||
|
||||
|
||||
console.log(clip)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
//////////////////////////
|
||||
// Query Tag Processing //
|
||||
//////////////////////////
|
||||
@@ -1,17 +0,0 @@
|
||||
async function checkForOutage() {
|
||||
var data = await fetch(`https://st.awexxx.xyz/heartbeat`)
|
||||
|
||||
console.log(data)
|
||||
|
||||
if (data.response !== 200) {
|
||||
document.getElementById(`status`).innerText = `offline!`
|
||||
document.getElementById(`addon`).innerText = `API didn't respond!`
|
||||
} else if (data.response === 200) {
|
||||
document.getElementById(`status`).innerText = `online!`
|
||||
document.getElementById(`addon`).innerText = `API responded when sent a heartbeat!`
|
||||
}
|
||||
|
||||
console.log(`Checked, checking in 10s`)
|
||||
|
||||
setTimeout(checkForOutage, 10000);
|
||||
}
|
||||
Reference in New Issue
Block a user