Compare commits

...

3 commits
main ... main

Author SHA1 Message Date
Pieter Vander Vennet
340f256074 Fix: fix #5 2024-12-26 17:23:54 +01:00
Pieter Vander Vennet
4a74e5c8bb Update README.md 2024-12-26 17:23:54 +01:00
d680cf9c88 Merge pull request 'Fix typo in README' (#4) from midgard/MastodonBot:main into main
Reviewed-on: MapComplete/MastodonBot#4
Reviewed-by: Pieter Vander Vennet <pietervdvn@nerdlab.nohost.me>
2024-12-17 23:53:27 +01:00
3 changed files with 14 additions and 2 deletions

View file

@ -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
This is a bot which is built to post a daily message about mapcomplete-usage.

View file

@ -1,6 +1,6 @@
{
"name": "mastodon-bot",
"version": "0.0.4",
"version": "0.0.5",
"author": "Pietervdvn",
"license": "GPL",
"description": "Experimenting with mastodon-bot",

View file

@ -68,7 +68,12 @@ export default class OsmUserInfo {
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)
if (await mastodonApi.hasNoBot(username)) {