Created
June 13, 2019 23:12
-
-
Save wybiral/deafa5fc11925d3e7d8f7f4c6bf3b9ab to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
body { | |
background: #000; | |
} | |
img { | |
max-height: 100px; | |
} | |
</style> | |
<script> | |
window.onload = () => { | |
const ws = new WebSocket('ws://localhost:8080'); | |
ws.onmessage = evt => { | |
const obj = JSON.parse(evt.data); | |
obj.images.forEach(src => { | |
const a = document.createElement('a'); | |
const img = document.createElement('img'); | |
img.src = src; | |
a.target = '_blank'; | |
a.href = 'https://twitter.com/a/status/' + obj.tweet_id; | |
a.appendChild(img); | |
document.body.appendChild(a); | |
}); | |
}; | |
}; | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment