Skip to content

Instantly share code, notes, and snippets.

@Utopiah
Last active April 9, 2022 10:15
Show Gist options
  • Save Utopiah/2492d95a9b8f1ea7c4829b30d896982a to your computer and use it in GitHub Desktop.
Save Utopiah/2492d95a9b8f1ea7c4829b30d896982a to your computer and use it in GitHub Desktop.
// for hubs, see https://twitter.com/utopiah/status/1495713341133791242
const owndomain = 'your-vartiste-glitch-remix.glitch.me'
const source = new EventSource('https://'+owndomain+'/sse');
source.onmessage = message => {
// hubs_utils from https://gist.github.com/Utopiah/1cfc123239fa2994569fc7c5c60b2928/
hubs_utils.getFirstElementFromPartialURL(owndomain+"/data/upload.glb")
.setAttribute("media-loader", "src", "https://"+owndomain+"/data/upload.glb#"+Date.now())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment