This post is about @TankieReplyBot@lemmygrad.ml. It’s a configurable bot running my lemmy-reply-bot software.
Currently, it has the following functionality:
- If one or more YouTube links are detected in a comment or post, the bot will reply with links to the same video on three different Invidious instances.
- If one or more Reddit links are detected in a comment or post, the bot will reply with links to the same location on various Teddit and Libreddit instances.
- If one or more URLs preceded by
!archive
are detected in a comment or post, the bot will reply with links to various archive sites for the URL.
Config file for my instance of the bot
[lemmy]
instanceURL = "wss://lemmygrad.ml"
[lemmy.account]
userOrEmail = "TankieReplyBot"
password = 'Insert Password Here'
[[reply]]
regex = '!archive (https?)://([.\w\d]+\.[\w\d]{2,4}[\w\d?&=%/.-]*)'
msg = '''
Here are the archive links you requested:
{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [archive.vn](https://archive.vn/{{$match.Item 1}}://{{$match.Item 2}})
- [archive.org](https://web.archive.org/web/{{$match.Item 1}}://{{$match.Item 2}})
- [ghostarchive.org](https://ghostarchive.org/search?term={{$match.Item 1}}://{{$match.Item 2}})
{{end}}
'''
[[reply]]
regex = '!paywall (https?)://([.\w\d]+\.[\w\d]{2,4}[\w\d?&=%/.-]*)'
msg = '''
One of these links should get rid of the paywall! :3
{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [1ft.io](https://1ft.io/{{$match.Item 1}}://{{$match.Item 2}})
- [12ft.io](https://12ft.io/{{$match.Item 1}}://{{$match.Item 2}})
- [archive.ph](https://archive.ph/{{$match.Item 1}}://{{$match.Item 2}})
{{end}}
'''
[[reply]]
regex = '(https?)://(www\.google\.com/amp/s/([.\w\d]+\.[\w\d]{2,4}[\w\d?&=%/.-]*))'
msg = '''
I found {{if len .Matches | eq 1}}a Google AMP link{{else}}Google AMP links{{end}} in your {{.Type}}! I've removed Google's spyware for you! :3
{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [Regular Link]({{$match.Item 1}}://{{regexReplaceAll `/?\.?amp` ($match.Item 3) ""}})
{{end}}
'''
[[reply]]
regex = 'https?://(?:(?:www|m)\.)?youtu(?:\.be/|be\.com/(?:watch\?v=|shorts/))([\w\d-]{11})[&?]?([\w\d?&=%/-]*)'
msg = '''
{{if len .Matches | eq 1}}A YouTube link was{{else}}YouTube links were{{end}} detected in your {{.Type}}. Here are links to the same {{if len .Matches | eq 1}}video{{else}}videos{{end}} on Invidious, which is a YouTube frontend that protects your privacy:
{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [yewtu.be](https://yewtu.be/watch?v={{$match.Item 1}}&{{$match.Item 2}})
- [inv.zzls.xyz](https://inv.zzls.xyz/watch?v={{$match.Item 1}}&{{$match.Item 2}})
- [invidious.io.lol](https://invidious.io.lol/watch?v={{$match.Item 1}}&{{$match.Item 2}})
{{end}}
'''
[[reply]]
regex = 'https?://(?:www\.|old\.)?reddit\.com/((?:r|user)/[\w\d?&=%/-]*)'
msg = '''
{{if len .Matches | eq 1}}A Reddit link was{{else}}Reddit links were{{end}} detected in your {{.Type}}. Here are links to the same {{if len .Matches | eq 1}}location{{else}}locations{{end}} on Teddit and Libreddit, which are Reddit frontends that protect your privacy.
{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [teddit.zaggy.nl](https://teddit.zaggy.nl/{{$match.Item 1}})
- [teddit.hostux.net](https://teddit.hostux.net/{{$match.Item 1}})
- [r.darklab.sh](https://r.darklab.sh/{{$match.Item 1}})
- [reddit.smnz.de](https://reddit.smnz.de/{{$match.Item 1}})
{{end}}
'''
[[reply]]
regex = 'https://(?:i\.)?imgur.com/((?:a|gallery)?/?[A-Za-z0-9]{5,8}(?:\.[a-zA-Z]+)?(?:[\w\d?&=%/.-]*))'
msg = '''
{{if len .Matches | eq 1}}An Imgur link was{{else}}Imgur links were{{end}} detected in your {{.Type}}. Here are links to the same {{if len .Matches | eq 1}}location{{else}}locations{{end}} on alternative frontends that protect your privacy.
{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [imgur.artemislena.eu](https://imgur.artemislena.eu/{{$match.Item 1}})
- [rimgo.projectsegfau.lt](https://rimgo.projectsegfau.lt/{{$match.Item 1}})
- [imgin.voidnet.tech](https://imgin.voidnet.tech/{{$match.Item 1}})
{{end}}
'''
This comment contains two archive commands, which the bot will reply to with archive sites:
- !archive https://arsenm.dev
- !archive https://prolewiki.org/
Here are the archive links you requested:
Link 1:
Link 2:
This comment contains 2 YouTube links that the bot will convert to Invidious links. The two latest Hakim videos: https://www.youtube.com/watch?v=9BwnP4wri0s, and https://www.youtube.com/watch?v=1f4rKycK6Gg
YouTube links were detected in your comment. Here are links to the same videos on Invidious, which is a YouTube frontend that protects your privacy:
Link 1:
Link 2:
This comment contains two Twitter links that the bot will convert to Nitter links: https://twitter.com/prolewiki/, and https://twitter.com/prolewiki/status/1614536180355465217.
Twitter links were detected in your comment. Here are links to the same locations on Nitter, which is a Twitter frontend that protects your privacy.
Link 1:
Link 2:
This comment contains two Reddit links that the bot will convert to Teddt/Libreddit links: https://www.reddit.com/r/LateStageCapitalism/, and https://www.reddit.com/r/LateStageCapitalism/comments/10c9ng0/they_do_get_so_close_to_getting_it_and_yet_so_far/.
Reddit links were detected in your comment. Here are links to the same locations on Teddit and Libreddit, which are Reddit frontends that protect your privacy.
Link 1:
Link 2: