Skip to content

Instantly share code, notes, and snippets.

@tauseedzaman
Created February 6, 2023 07:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tauseedzaman/2ce1b14c6dbe3f41f08e3b2bfd625985 to your computer and use it in GitHub Desktop.
Save tauseedzaman/2ce1b14c6dbe3f41f08e3b2bfd625985 to your computer and use it in GitHub Desktop.
the-eye
<!DOCTYPE html>
<html>
<head>
<script>
function readTextFile(file) {
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function() {
if (rawFile.readyState === 4) {
if (rawFile.status === 200 || rawFile.status == 0) {
var allText = rawFile.responseText;
displayImages(allText);
}
}
};
rawFile.send(null);
}
function displayImages(filenames) {
var imageContainer = document.getElementById("imageContainer");
var filenamesArray = filenames.split("\n");
for (var i = 0; i < 500; i++) {
var filename = filenamesArray[i];
if (filename) {
var image = document.createElement("img");
image.src = filename;
image.style.width = "100px";
image.style.height = "100px";
image.style.display = "inline-block";
imageContainer.appendChild(image);
}
}
}
</script>
</head>
<body onload="readTextFile('https://the-eye.eu/public/social/twitter/ukraine/images/urls/0004_images.txt')">
<div id="imageContainer"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment