f323ba1
use crate::parse::{EmbedRule, Platform};
use crate::Category;
pub struct RedditShort;
impl Platform for RedditShort {
fn id(&self) -> &'static str {
"reddit-short"
}
fn name(&self) -> &'static str {
"Reddit 短链"
}
fn category(&self) -> Category {
Category::Forum
}
fn domains(&self) -> &'static [&'static str] {
&["redd.it"]
}
fn embed_rule(&self) -> Option<EmbedRule> {
Some(
EmbedRule::capture(
r"^/([A-Za-z0-9]+)",
"https://www.redditmedia.com/comments/{id}?embed=true",
crate::Aspect::Auto,
)
.fixed_height(500),
)
}
}
pub static PLATFORM: RedditShort = RedditShort;