mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-06-13 09:21:12 +00:00
Add urlmeta with added-at info (#44)
This commit is contained in:
@@ -8,7 +8,28 @@ function sortSection (values) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const original = JSON.parse(fs.readFileSync('all.json', 'utf-8'));
|
const original = JSON.parse(fs.readFileSync('all.json', 'utf-8'));
|
||||||
|
const meta = JSON.parse(fs.readFileSync('urlmeta.json', 'utf-8'));
|
||||||
|
|
||||||
|
// sorted order for all entries
|
||||||
const allow = sortSection(original.allow);
|
const allow = sortSection(original.allow);
|
||||||
const deny = sortSection(original.deny);
|
const deny = sortSection(original.deny);
|
||||||
|
|
||||||
|
// rewrite with all our entries (newline included)
|
||||||
fs.writeFileSync('all.json', `${JSON.stringify({ allow, deny }, null, 2)}\n`);
|
fs.writeFileSync('all.json', `${JSON.stringify({ allow, deny }, null, 2)}\n`);
|
||||||
|
|
||||||
|
// find out what we don't have
|
||||||
|
const urls = meta.map(({ url }) => url);
|
||||||
|
const now = new Date();
|
||||||
|
const date = `${now.getUTCFullYear()}-${`00${now.getUTCMonth() + 1}`.slice(-2)}-${`00${now.getUTCDate()}`.slice(-2)}`;
|
||||||
|
|
||||||
|
// rewrite with all our entries (newline included)
|
||||||
|
fs.writeFileSync('urlmeta.json', `${JSON.stringify(
|
||||||
|
meta
|
||||||
|
.concat(
|
||||||
|
deny
|
||||||
|
.filter((url) => !urls.includes(url))
|
||||||
|
.map((url) => ({ date, url }))
|
||||||
|
)
|
||||||
|
.sort((a, b) => a.url.localeCompare(b.url)),
|
||||||
|
null, 2
|
||||||
|
)}\n`);
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"date": "2020-10-18",
|
||||||
|
"url": "dothereum-polkadot.net"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2020-10-14",
|
||||||
|
"url": "polkadot-dot.info"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2020-12-30",
|
||||||
|
"url": "polkadot-wallet.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2020-12-02",
|
||||||
|
"url": "polkadot.com.se"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2020-12-30",
|
||||||
|
"url": "polkadotfund.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2020-10-14",
|
||||||
|
"url": "polkawallets.site"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2020-10-14",
|
||||||
|
"url": "polkodot.network"
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user