Fetch changeset info from OSM api to detect all images (workaround for https://github.com/mapbox/osmcha-frontend/issues/641); send a direct message to bot owner when running; improve usernames of image authors

This commit is contained in:
Pieter Vander Vennet 2023-01-16 01:54:51 +01:00
parent 70a7224160
commit e7e2d8609f
7 changed files with 131 additions and 56 deletions

View file

@ -39,6 +39,17 @@ export default class OsmUserInfo {
}
}
public async GetMastodonLink(): Promise<string | undefined> {
const mastodonLinks = await this.getMeLinks()
if (mastodonLinks.length <= 0) {
return undefined
}
const url = new URL(mastodonLinks[0])
return url.pathname.substring(1) + "@" + url.host
}
public async getMeLinks(): Promise<string[]> {
const userdata = await this.getUserInfo()