mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 01:30:37 +08:00
18 lines
513 B
TypeScript
18 lines
513 B
TypeScript
import { fetchRemoteTextByLine } from './lib/fetch-text-by-line';
|
|
import tldts from 'tldts';
|
|
|
|
(async () => {
|
|
const lines = await Array.fromAsync(await fetchRemoteTextByLine('https://raw.githubusercontent.com/durablenapkin/block/master/luminati.txt', true));
|
|
|
|
const set = new Set<string>();
|
|
|
|
lines.forEach((line) => {
|
|
const apexDomain = tldts.getDomain(line.slice(8));
|
|
if (apexDomain) {
|
|
set.add(apexDomain);
|
|
}
|
|
});
|
|
|
|
console.log(Array.from(set).map(line => '.' + line).join('\n'));
|
|
})();
|