Files
  • index.js
  • images.txt
  • package-lock.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const express = require('express');
const app = express();

const fs = require('fs');

let images = [];

fs.readFile('images.txt', 'utf8', (err, data) => {
  images = data.split('\n');
});

app.get('/', (req, res) => {
  let body = "";
  for (const url of images) {
    body += `<a href="${url}">${url}</a><br>`;
    body += `<img src="${url}"><br>`;
  }
  res.end(body);
});

app.listen(process.env.PORT);


const request = require('request')

const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"


function update() {
  let body = "";
  let i = 0;
  const temp = [];
  const interval = setInterval(() => {
    if (i > chars.length ** 3) {
      clearInterval(interval);
      temp.sort();
      images = temp;
      return;
    }
    const url = "https://www.imag.cf/" + chars[Math.floor(i / chars.length ** 2 % chars.length)] + chars[Math.floor(i / chars.length % chars.length)] + chars[i % chars.length]
    request({
      method: 'get',
      uri: url,
      resolveWithFullResponse: true
    }, (err, res, body) => {
      if (err) return;
      if (res.statusCode != 404) temp.push(url);
    })
    i++
  }, 5);
}

setInterval(update, 1000 * 60 * 30);
node v10.15.2 linux/amd64