0.0.1
This commit is contained in:
15
providers/reddit.py
Normal file
15
providers/reddit.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from .base import EmbedProvider
|
||||
|
||||
class RedditProvider(EmbedProvider):
|
||||
name = "reddit"
|
||||
pattern = r"\{\{REDDIT:(https?://[^\}]+)\}\}"
|
||||
|
||||
def replace(self, match):
|
||||
url = match.group(1)
|
||||
|
||||
embed_html = f'''
|
||||
<blockquote class="reddit-embed-bq" data-embed-locale="en-EN" data-embed-theme="dark" data-embed-showedits="false" data-embed-created="2026-02-25T21:30:20.003Z" data-embed-showusername="false" style="height:500px" data-embed-height="546" >
|
||||
<a href="{url}"></a>
|
||||
</blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"></script>
|
||||
'''
|
||||
return self.wrap_template("reddit", embed_html)
|
||||
Reference in New Issue
Block a user