Last active
October 14, 2019 16:17
-
-
Save nfreear/326550f80111bbeaf01d52d730881057 to your computer and use it in GitHub Desktop.
Redirect to OU-IET ... RDFa markup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html><html lang="en"> | |
<title>Redirecting to : Institute of Educational Technology, The Open University</title> | |
<style> | |
body { color: #333; font: 1rem sans-serif; margin: 1rem auto; max-width: 31rem; } | |
h1, h2, h3, h4 { font-weight: normal; } | |
</style> | |
<div vocab="http://schema.org/" typeof="WebSite"> | |
<h1 property="name"> Institute of Educational Technology </h1> | |
<h2 property="publisher" typeof="Organization"> The Open University </h2> | |
<h3 property="potentialAction" role="alert"> | |
Redirecting to <a property="target" href="https://iet.open.ac.uk/">iet.open.ac.uk</a> in <b property="temporal"> 5 </b> seconds. | |
</h3> | |
<small><a href="?redirect=0" role="button"> (stop) </a></small> | |
</div> | |
<script> | |
// Redirect based on RDFa markup (https://schema.org/WebSite) | |
const SITE = document.querySelector('[ typeof = WebSite ]'); | |
const REDIRECT = { | |
temporal: SITE.querySelector('[ property = temporal ]').innerText, | |
target: SITE.querySelector('[ property = target ]').href | |
}; | |
REDIRECT._temporal_ms = REDIRECT.temporal * 1000; | |
console.warn("Redirect action:", REDIRECT); | |
if (! /redirect=0/.test(window.location.href)) { | |
window.setTimeout(() => window.location = REDIRECT.target, REDIRECT._temporal_ms) | |
} | |
let countDown = REDIRECT.temporal * 1; | |
window.setInterval(() => console.debug(countDown --), 1000); | |
</script> | |
<!-- Location :~ https://www.edtech.institute/ --> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment