Twitch Oauth implemented (by hand)
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>master
parent
8dbe61da21
commit
b547819234
@ -1,4 +1,4 @@
|
||||
{
|
||||
"channels": ["iMartynOnTwitch"],
|
||||
"channels": ["karaokards"],
|
||||
"externalUrl": "karaokards.ing.martyn.berlin"
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
<html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Karaokards">
|
||||
<meta name="author" content="Martyn Ranyard">
|
||||
<title>Please Stand By!</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
|
||||
<!-- Custom styles for this template -->
|
||||
<link href="/cover.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
.bd-placeholder-img {
|
||||
font-size: 1.125rem;
|
||||
text-anchor: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bd-placeholder-img-lg {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
li.match-nomatch{
|
||||
background-color: #1e2122;
|
||||
}
|
||||
li.match-matchtrack{
|
||||
background-color: #E9B000;
|
||||
}
|
||||
li.match-fullmatch{
|
||||
background-color: #008F95;
|
||||
}
|
||||
li.match-matchtrackfuzzt{
|
||||
background-color: darkgray;
|
||||
}
|
||||
li.match-fullmatchfuzzy{
|
||||
background-color: darkgray;
|
||||
}
|
||||
a{
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="text-center" onload=directToResults()>
|
||||
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
|
||||
<header class="masthead mb-auto">
|
||||
<div class="inner">
|
||||
<h3 class="masthead-brand">Karaokards</h3>
|
||||
<nav class="nav nav-masthead justify-content-center">
|
||||
<a class="nav-link active" href="/">Home</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main" class="inner cover">
|
||||
<h1 class="cover-heading">Please stand by, twitch gives us stuff that needs to be sent to the server!</h1>
|
||||
<img src="https://media.giphy.com/media/ule4vhcY1xEKQ/source.gif" alt="Cats typing furiously" />
|
||||
<p/>
|
||||
<p>Just hold on, the javascript is doing it's stuff. Don't blame me, twitch really forces us to use javascript here.</p>
|
||||
<p>Shameless self-promotion : Follow me on twitch - <a href="https://www.twitch.tv/iMartynOnTwitch">iMartynOnTwitch</a>, oddly enough, I do a lot of twitchsings!</p>
|
||||
</main>
|
||||
<footer class="mastfoot mt-auto">
|
||||
<div class="inner">
|
||||
<p>Cover template for <a href="https://getbootstrap.com/">Bootstrap</a>, by <a href="https://twitter.com/mdo">@mdo</a>.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script>
|
||||
// #access_token=hkq5diaiopu23tzyo5oik7jl7g2w0n&scope=user%3Aread%3Abroadcast&token_type=bearer
|
||||
|
||||
function directToResults() {
|
||||
var url = document.createElement('a');
|
||||
url.setAttribute("href", window.location.href);
|
||||
if ((url.port != 80) && (url.port != 443)) {
|
||||
customPort = ":"+url.port
|
||||
} else {
|
||||
customPort = ""
|
||||
}
|
||||
|
||||
u = new URLSearchParams(document.location.hash.substr(1))
|
||||
var destination = new URL(url.protocol + "//" + url.hostname + customPort + "/twitchtobackend?" + u.toString())
|
||||
console.log(destination)
|
||||
window.location.href = destination
|
||||
}
|
||||
|
||||
function toggleUnfound() {
|
||||
var unmatched = document.getElementsByClassName('match-nomatch'), i;
|
||||
if (document.getElementById("showhidebutton").getAttribute("tracksHidden") != "true") {
|
||||
document.getElementById("showhidebutton").setAttribute("tracksHidden","true")
|
||||
for (i = 0; i < unmatched.length; i += 1) {
|
||||
unmatched[i].style.display = 'none';
|
||||
}
|
||||
} else {
|
||||
document.getElementById("showhidebutton").setAttribute("tracksHidden","false")
|
||||
for (i = 0; i < unmatched.length; i += 1) {
|
||||
unmatched[i].style.display = 'list-item';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue