Compare commits
2 commits
d680cf9c88
...
340f256074
Author | SHA1 | Date | |
---|---|---|---|
|
340f256074 | ||
|
4a74e5c8bb |
3 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
# REPO MOVED!
|
||||||
|
|
||||||
|
Hey,
|
||||||
|
|
||||||
|
The development for this repository moved to [source.mapcomplete.org](https://source.mapcomplete.org/MapComplete/MastodonBot)
|
||||||
|
Pull requests, issues, ... are welcome there
|
||||||
|
|
||||||
# Mastodon-Bot
|
# Mastodon-Bot
|
||||||
|
|
||||||
This is a bot which is built to post a daily message about mapcomplete-usage.
|
This is a bot which is built to post a daily message about mapcomplete-usage.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mastodon-bot",
|
"name": "mastodon-bot",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"author": "Pietervdvn",
|
"author": "Pietervdvn",
|
||||||
"license": "GPL",
|
"license": "GPL",
|
||||||
"description": "Experimenting with mastodon-bot",
|
"description": "Experimenting with mastodon-bot",
|
||||||
|
|
|
@ -68,7 +68,12 @@ export default class OsmUserInfo {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = new URL(mastodonLinks[0])
|
let mastodonlink = mastodonLinks[0]
|
||||||
|
while(mastodonlink.endsWith("/")){
|
||||||
|
mastodonlink = mastodonlink.substring(0, mastodonlink.length - 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = new URL(mastodonlink)
|
||||||
const username = url.pathname.split("/").at(-1) + (url.host === mastodonApi.hostname ? "" : "@" + url.host)
|
const username = url.pathname.split("/").at(-1) + (url.host === mastodonApi.hostname ? "" : "@" + url.host)
|
||||||
|
|
||||||
if (await mastodonApi.hasNoBot(username)) {
|
if (await mastodonApi.hasNoBot(username)) {
|
||||||
|
|
Loading…
Reference in a new issue