Post 9ytEXB6eUWTMZeLc80 by grufwub@notbird.site
(DIR) More posts by grufwub@notbird.site
(DIR) Post #9ytCYJENZOAg9ZNDWq by grufwub@notbird.site
2020-09-06T17:26:21Z
0 likes, 0 repeats
Update! @FediReminder bot should now strip out any CW HTML tags in statuses so this shouldn't cause issues of unrecognized commands anymoreI was thinking of adding a `remind me on [this date]` support, but taking into account time zones etc felt a bit too complex. i like keeping this project simple
(DIR) Post #9ytCYJirk2Ydg7dZ32 by grufwub@notbird.site
2020-09-06T17:40:12Z
0 likes, 0 repeats
the regex for it really ain't pretty, basically just:.*<p>.*(?P<command>[cmd regex here])\s*</p>so as long as you @ the bot and have the last paragraph ending in either `help` or `remind me in ___` you should be parsed just fineif anyone has a better way of stripping away unnecessary HTML tags without bringing in 3rd party libraries, i am open to suggestions :)
(DIR) Post #9ytCYKBa1HWh7B4Unw by grufwub@notbird.site
2020-09-06T17:42:49Z
0 likes, 0 repeats
the current mastodon library unfortunately doesn't work with web sockets (they're supported, i just can't get them working) so i'm doing a timed refresh of a GetNotifications(page) style methodi'm tempted for my own learning to write my own code here and strip the only third party library in use
(DIR) Post #9ytCYKMZMQJhfGDGvw by carbontwelve@d20hero.club
2020-09-06T17:48:15.336569Z
0 likes, 0 repeats
@grufwub are you writing this in golang?
(DIR) Post #9ytCuiW8EiguwrMVXc by grufwub@notbird.site
2020-09-06T17:51:06Z
1 likes, 0 repeats
@carbontwelve yep
(DIR) Post #9ytD2dJLTdCt7O9jHM by carbontwelve@d20hero.club
2020-09-06T17:53:44.419971Z
0 likes, 0 repeats
@grufwub I’ve been tinkering with building a bot in golang too. There seems to be only one library that I found written to do all the heavy lifting; I was about to begin working on auto responding to notification streams but couldn’t figure out how they worked.
(DIR) Post #9ytEDDS83e3Q3ksHj6 by grufwub@notbird.site
2020-09-06T18:04:49Z
1 likes, 0 repeats
@carbontwelve i couldn't get the user web socket stream to work, so i've set up a goroutine that regularly refreshes the notification method and handles mentions
(DIR) Post #9ytEXB6eUWTMZeLc80 by grufwub@notbird.site
2020-09-06T18:09:06Z
1 likes, 0 repeats
@carbontwelve this is where i'm handling that if you are interested: https://github.com/grufwub/FediReminder/blob/755b6f0c7004a22770db92db40321eb75c109d46/main.go#L245-L282
(DIR) Post #9ytFmBVXNh0Q7IhtiK by carbontwelve@d20hero.club
2020-09-06T18:24:24.015350Z
0 likes, 0 repeats
@grufwub ooh that is very helpful indeed. Thank you for sharing. 😊
(DIR) Post #9ytRcQ3tc4rhoGt7J2 by grufwub@notbird.site
2020-09-06T17:46:16Z
1 likes, 0 repeats
maybe write my own equivalent of the httprouter's (a 3rd party HTTP routing library faster than default net/http) interface but for mastodon bots.so you create a mastodon bot instance and respond to different notifications with like:.Mention(<status matching string>, handleFunc).Favourite(handleFunc).Boost(handleFunc).Follow(handleFunc)