Add 'masto' to whitelist

This commit is contained in:
Pieter Vander Vennet 2025-07-12 18:41:13 +02:00
parent 338b9526ec
commit f3d4f57d80
3 changed files with 11 additions and 4 deletions

View file

@ -186,8 +186,8 @@ ${text.split("\n").map(txt => " > " + txt).join("\n")}`)
return overview.length + rest.join("\n").length + 1
}
private static notMastodon = ["wiki.openstreetmap.org", "hdyc.neis-one.org", "matrix.to"]
private static isMastodon = ["en.osm.town", ".social", "mstdn", "mastodon", "mapstodon"]
private static notMastodon = ["wiki.openstreetmap.org", "hdyc.neis-one.org", "matrix.to","facebook.com"]
private static isMastodon = ["en.osm.town", ".social", "mstdn", "mastodon", "mapstodon","masto"]
static isProbablyMastodonLink(link: string) {
if (this.isMastodon.some(white => link.indexOf(white) >= 0)) {

View file

@ -106,4 +106,5 @@ export class Main {
}
new Main(process.argv[2], process.argv[3], process.argv[4] !== undefined).main().then(_ => console.log("All done"))
const args = process.argv.slice(2)
new Main(args[0], args[1], args[2] !== undefined).main().then(_ => console.log("All done"))

View file

@ -1,6 +1,12 @@
import OsmUserInfo from "./OsmUserInfo";
import MastodonPoster from "./Mastodon";
console.log("Hello world")
new OsmUserInfo(3818858).getMeLinks().then(links => console.log("Got links:", links))
new OsmUserInfo(1214300).getMeLinks().then(links => {
console.log("Got links:", links);
for (const link of links) {
console.log(link, MastodonPoster.isProbablyMastodonLink(link) ? "Mastodon" : "NOT mastodon")
}
})