b453d5d
use crate::parse::{EmbedRule, Platform};
use crate::Category;
pub struct Facebook;
impl Platform for Facebook {
fn id(&self) -> &'static str {
"facebook"
}
fn name(&self) -> &'static str {
"Facebook"
}
fn category(&self) -> Category {
Category::Social
}
fn domains(&self) -> &'static [&'static str] {
&["facebook.com", "fb.com", "fb.watch", "fb.me"]
}
fn embed_rule(&self) -> Option<EmbedRule> {
// 插件地址自带 `width=552`,高度随内容变化,给一个能装下常见帖子的值。
Some(
EmbedRule::frame(
"https://www.facebook.com/plugins/post.php?href={url_enc}&show_text=true&width=552",
)
.fixed_height(520),
)
}
}
pub static PLATFORM: Facebook = Facebook;