feat(social): URL to platform embed registry
New workspace crate holding a static registry of ~430 providers, one file each (社交/电商/视频/音乐/新闻/论坛/直播/知识/开发工具 and an Other fallback), plus the matcher and the renderer: - parse: platform table with host/path patterns, category, embed kind and the oEmbed endpoint a site advertises; pure data, no I/O. - resolve: embed()/embed_json()/is_supported()/oembed_endpoint(), and an enriched variant that only adopts third-party markup whose iframe src stays inside the provider's own declared domains. - render: builds the injectable HTML - iframe/video/audio/img where the site allows framing, a branded link card where X-Frame-Options or CSP would block it - with its own HTML escaping. Matching and rendering never touch the network, so the whole path is safe to call synchronously from the message write path; only oEmbed discovery consumes a caller-supplied fetch. Dependencies added to the workspace: regex, url, percent-encoding.
ZhenYi committed
This change is very large, so some diffs are not shown. Clone the repository to see the full change.
Added lib/social/examples/dump.rs lib/social/examples/dump.rs +22 −0 View lib/social/examples/dump.rs
@@ -0,0 +1,22 @@
1fn main() {
2 for platform in social::providers() {
3 let (kind, aspect, pattern, src) = match platform.embed_rule() {
4 None => ("CARD", "", "", ""),
5 Some(rule) => match rule.pattern {
6 None => ("frame", rule.aspect.as_str(), "", rule.src),
7 Some(pattern) => ("fid", rule.aspect.as_str(), pattern, rule.src),
8 },
9 };
10 println!(
11 "{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}",
12 platform.id(),
13 platform.name(),
14 platform.category().as_str(),
15 platform.domains().join(","),
16 kind,
17 aspect,
18 pattern,
19 src
20 );
21 }
22}
Added lib/social/src/parse/acfun.rs lib/social/src/parse/acfun.rs +33 −0 View lib/social/src/parse/acfun.rs
@@ -0,0 +1,33 @@
1//! AcFun — 视频 — acfun.cn
2//!
3//! acfun
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// AcFun — 视频 — acfun.cn
9pub struct Acfun;
10
11impl Platform for Acfun {
12 fn id(&self) -> &'static str {
13 "acfun"
14 }
15
16 fn name(&self) -> &'static str {
17 "AcFun"
18 }
19
20 fn category(&self) -> Category {
21 Category::Video
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["acfun.cn"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide(r"^/v/ac(\d+)", "https://www.acfun.cn/player/ac{id}"))
30 }
31}
32
33pub static PLATFORM: Acfun = Acfun;
Added lib/social/src/parse/adidas.rs lib/social/src/parse/adidas.rs +34 −0 View lib/social/src/parse/adidas.rs
@@ -0,0 +1,34 @@
1//! Adidas — 电商 — adidas.com, adidas.co.uk, adidas.de
2//!
3//! adidas
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Adidas — 电商 — adidas.com, adidas.co.uk, adidas.de
10pub struct Adidas;
11
12impl Platform for Adidas {
13 fn id(&self) -> &'static str {
14 "adidas"
15 }
16
17 fn name(&self) -> &'static str {
18 "Adidas"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["adidas.com", "adidas.co.uk", "adidas.de"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Adidas = Adidas;
Added lib/social/src/parse/agoda.rs lib/social/src/parse/agoda.rs +34 −0 View lib/social/src/parse/agoda.rs
@@ -0,0 +1,34 @@
1//! Agoda — 电商 — agoda.com
2//!
3//! agoda
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Agoda — 电商 — agoda.com
10pub struct Agoda;
11
12impl Platform for Agoda {
13 fn id(&self) -> &'static str {
14 "agoda"
15 }
16
17 fn name(&self) -> &'static str {
18 "Agoda"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["agoda.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Agoda = Agoda;
Added lib/social/src/parse/airbnb.rs lib/social/src/parse/airbnb.rs +34 −0 View lib/social/src/parse/airbnb.rs
@@ -0,0 +1,34 @@
1//! Airbnb — 电商 — airbnb.com, airbnb.cn, airbnb.co.uk
2//!
3//! airbnb
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Airbnb — 电商 — airbnb.com, airbnb.cn, airbnb.co.uk
10pub struct Airbnb;
11
12impl Platform for Airbnb {
13 fn id(&self) -> &'static str {
14 "airbnb"
15 }
16
17 fn name(&self) -> &'static str {
18 "Airbnb"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["airbnb.com", "airbnb.cn", "airbnb.co.uk"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Airbnb = Airbnb;
Added lib/social/src/parse/airtable.rs lib/social/src/parse/airtable.rs +34 −0 View lib/social/src/parse/airtable.rs
@@ -0,0 +1,34 @@
1//! Airtable — 开发 — airtable.com
2//!
3//! airtable
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Airtable — 开发 — airtable.com
10pub struct Airtable;
11
12impl Platform for Airtable {
13 fn id(&self) -> &'static str {
14 "airtable"
15 }
16
17 fn name(&self) -> &'static str {
18 "Airtable"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["airtable.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Airtable = Airtable;
Added lib/social/src/parse/aliexpress.rs lib/social/src/parse/aliexpress.rs +34 −0 View lib/social/src/parse/aliexpress.rs
@@ -0,0 +1,34 @@
1//! 速卖通 — 电商 — aliexpress.com, aliexpress.ru, aliexpress.us
2//!
3//! aliexpress
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 速卖通 — 电商 — aliexpress.com, aliexpress.ru, aliexpress.us
10pub struct Aliexpress;
11
12impl Platform for Aliexpress {
13 fn id(&self) -> &'static str {
14 "aliexpress"
15 }
16
17 fn name(&self) -> &'static str {
18 "速卖通"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["aliexpress.com", "aliexpress.ru", "aliexpress.us"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Aliexpress = Aliexpress;
Added lib/social/src/parse/alipay.rs lib/social/src/parse/alipay.rs +34 −0 View lib/social/src/parse/alipay.rs
@@ -0,0 +1,34 @@
1//! 支付宝 — 电商 — alipay.com, alipay.cn, alipayobjects.com
2//!
3//! alipay
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 支付宝 — 电商 — alipay.com, alipay.cn, alipayobjects.com
10pub struct Alipay;
11
12impl Platform for Alipay {
13 fn id(&self) -> &'static str {
14 "alipay"
15 }
16
17 fn name(&self) -> &'static str {
18 "支付宝"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["alipay.com", "alipay.cn", "alipayobjects.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Alipay = Alipay;
Added lib/social/src/parse/amazon.rs lib/social/src/parse/amazon.rs +34 −0 View lib/social/src/parse/amazon.rs
@@ -0,0 +1,34 @@
1//! Amazon — 电商 — amazon.com, amazon.co.uk, amazon.de, amazon.co.jp, amazon.cn, amazon.in, amazon.fr, amazon.ca, amazon.com.au, amazon.com.mx, amazon.es, amazon.it, amazon.com.br, amazon.nl, amazon.sg, amazon.ae, amazon.sa, amazon.se, amazon.pl, amazon.com.tr, amazon.eg, amzn.to, amzn.eu
2//!
3//! amazon
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Amazon — 电商 — amazon.com, amazon.co.uk, amazon.de, amazon.co.jp, amazon.cn, amazon.in, amazon.fr, amazon.ca, amazon.com.au, amazon.com.mx, amazon.es, amazon.it, amazon.com.br, amazon.nl, amazon.sg, amazon.ae, amazon.sa, amazon.se, amazon.pl, amazon.com.tr, amazon.eg, amzn.to, amzn.eu
10pub struct Amazon;
11
12impl Platform for Amazon {
13 fn id(&self) -> &'static str {
14 "amazon"
15 }
16
17 fn name(&self) -> &'static str {
18 "Amazon"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["amazon.com", "amazon.co.uk", "amazon.de", "amazon.co.jp", "amazon.cn", "amazon.in", "amazon.fr", "amazon.ca", "amazon.com.au", "amazon.com.mx", "amazon.es", "amazon.it", "amazon.com.br", "amazon.nl", "amazon.sg", "amazon.ae", "amazon.sa", "amazon.se", "amazon.pl", "amazon.com.tr", "amazon.eg", "amzn.to", "amzn.eu"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Amazon = Amazon;
Added lib/social/src/parse/amazonmusic.rs lib/social/src/parse/amazonmusic.rs +34 −0 View lib/social/src/parse/amazonmusic.rs
@@ -0,0 +1,34 @@
1//! Amazon Music — 音乐 — music.amazon.com
2//!
3//! amazonmusic
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Amazon Music — 音乐 — music.amazon.com
10pub struct Amazonmusic;
11
12impl Platform for Amazonmusic {
13 fn id(&self) -> &'static str {
14 "amazonmusic"
15 }
16
17 fn name(&self) -> &'static str {
18 "Amazon Music"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["music.amazon.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Amazonmusic = Amazonmusic;
Added lib/social/src/parse/anchor.rs lib/social/src/parse/anchor.rs +34 −0 View lib/social/src/parse/anchor.rs
@@ -0,0 +1,34 @@
1//! Spotify for Podcasters — 音乐 — anchor.fm
2//!
3//! anchor
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Spotify for Podcasters — 音乐 — anchor.fm
10pub struct Anchor;
11
12impl Platform for Anchor {
13 fn id(&self) -> &'static str {
14 "anchor"
15 }
16
17 fn name(&self) -> &'static str {
18 "Spotify for Podcasters"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["anchor.fm"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Anchor = Anchor;
Added lib/social/src/parse/android.rs lib/social/src/parse/android.rs +34 −0 View lib/social/src/parse/android.rs
@@ -0,0 +1,34 @@
1//! Android — 开发 — developer.android.com, android.com
2//!
3//! android
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Android — 开发 — developer.android.com, android.com
10pub struct Android;
11
12impl Platform for Android {
13 fn id(&self) -> &'static str {
14 "android"
15 }
16
17 fn name(&self) -> &'static str {
18 "Android"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["developer.android.com", "android.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Android = Android;
Added lib/social/src/parse/anghami.rs lib/social/src/parse/anghami.rs +34 −0 View lib/social/src/parse/anghami.rs
@@ -0,0 +1,34 @@
1//! Anghami — 音乐 — anghami.com
2//!
3//! anghami
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Anghami — 音乐 — anghami.com
10pub struct Anghami;
11
12impl Platform for Anghami {
13 fn id(&self) -> &'static str {
14 "anghami"
15 }
16
17 fn name(&self) -> &'static str {
18 "Anghami"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["anghami.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Anghami = Anghami;
Added lib/social/src/parse/anthropic.rs lib/social/src/parse/anthropic.rs +34 −0 View lib/social/src/parse/anthropic.rs
@@ -0,0 +1,34 @@
1//! Anthropic — 开发 — anthropic.com, claude.ai
2//!
3//! anthropic
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Anthropic — 开发 — anthropic.com, claude.ai
10pub struct Anthropic;
11
12impl Platform for Anthropic {
13 fn id(&self) -> &'static str {
14 "anthropic"
15 }
16
17 fn name(&self) -> &'static str {
18 "Anthropic"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["anthropic.com", "claude.ai"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Anthropic = Anthropic;
Added lib/social/src/parse/apnews.rs lib/social/src/parse/apnews.rs +34 −0 View lib/social/src/parse/apnews.rs
@@ -0,0 +1,34 @@
1//! AP News — 新闻 — apnews.com
2//!
3//! apnews
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// AP News — 新闻 — apnews.com
10pub struct Apnews;
11
12impl Platform for Apnews {
13 fn id(&self) -> &'static str {
14 "apnews"
15 }
16
17 fn name(&self) -> &'static str {
18 "AP News"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["apnews.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Apnews = Apnews;
Added lib/social/src/parse/apple_dev.rs lib/social/src/parse/apple_dev.rs +34 −0 View lib/social/src/parse/apple_dev.rs
@@ -0,0 +1,34 @@
1//! Apple Developer — 开发 — developer.apple.com
2//!
3//! apple-dev
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Apple Developer — 开发 — developer.apple.com
10pub struct AppleDev;
11
12impl Platform for AppleDev {
13 fn id(&self) -> &'static str {
14 "apple-dev"
15 }
16
17 fn name(&self) -> &'static str {
18 "Apple Developer"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["developer.apple.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: AppleDev = AppleDev;
Added lib/social/src/parse/applemusic.rs lib/social/src/parse/applemusic.rs +33 −0 View lib/social/src/parse/applemusic.rs
@@ -0,0 +1,33 @@
1//! Apple Music — 音乐 — music.apple.com
2//!
3//! applemusic
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Apple Music — 音乐 — music.apple.com
9pub struct Applemusic;
10
11impl Platform for Applemusic {
12 fn id(&self) -> &'static str {
13 "applemusic"
14 }
15
16 fn name(&self) -> &'static str {
17 "Apple Music"
18 }
19
20 fn category(&self) -> Category {
21 Category::Music
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["music.apple.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://embed.music.apple.com{path}"))
30 }
31}
32
33pub static PLATFORM: Applemusic = Applemusic;
Added lib/social/src/parse/appletv.rs lib/social/src/parse/appletv.rs +34 −0 View lib/social/src/parse/appletv.rs
@@ -0,0 +1,34 @@
1//! Apple TV+ — 视频 — tv.apple.com
2//!
3//! appletv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Apple TV+ — 视频 — tv.apple.com
10pub struct Appletv;
11
12impl Platform for Appletv {
13 fn id(&self) -> &'static str {
14 "appletv"
15 }
16
17 fn name(&self) -> &'static str {
18 "Apple TV+"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["tv.apple.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Appletv = Appletv;
Added lib/social/src/parse/archive.rs lib/social/src/parse/archive.rs +34 −0 View lib/social/src/parse/archive.rs
@@ -0,0 +1,34 @@
1//! Internet Archive — 视频 — archive.org
2//!
3//! archive
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Internet Archive — 视频 — archive.org
10pub struct Archive;
11
12impl Platform for Archive {
13 fn id(&self) -> &'static str {
14 "archive"
15 }
16
17 fn name(&self) -> &'static str {
18 "Internet Archive"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["archive.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Archive = Archive;
Added lib/social/src/parse/archlinux.rs lib/social/src/parse/archlinux.rs +34 −0 View lib/social/src/parse/archlinux.rs
@@ -0,0 +1,34 @@
1//! Arch Linux — 开发 — archlinux.org
2//!
3//! archlinux
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Arch Linux — 开发 — archlinux.org
10pub struct Archlinux;
11
12impl Platform for Archlinux {
13 fn id(&self) -> &'static str {
14 "archlinux"
15 }
16
17 fn name(&self) -> &'static str {
18 "Arch Linux"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["archlinux.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Archlinux = Archlinux;
Added lib/social/src/parse/arxiv.rs lib/social/src/parse/arxiv.rs +34 −0 View lib/social/src/parse/arxiv.rs
@@ -0,0 +1,34 @@
1//! arXiv — 知识 — arxiv.org
2//!
3//! arxiv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// arXiv — 知识 — arxiv.org
10pub struct Arxiv;
11
12impl Platform for Arxiv {
13 fn id(&self) -> &'static str {
14 "arxiv"
15 }
16
17 fn name(&self) -> &'static str {
18 "arXiv"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["arxiv.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Arxiv = Arxiv;
Added lib/social/src/parse/asana.rs lib/social/src/parse/asana.rs +34 −0 View lib/social/src/parse/asana.rs
@@ -0,0 +1,34 @@
1//! Asana — 开发 — asana.com
2//!
3//! asana
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Asana — 开发 — asana.com
10pub struct Asana;
11
12impl Platform for Asana {
13 fn id(&self) -> &'static str {
14 "asana"
15 }
16
17 fn name(&self) -> &'static str {
18 "Asana"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["asana.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Asana = Asana;
Added lib/social/src/parse/askfm.rs lib/social/src/parse/askfm.rs +34 −0 View lib/social/src/parse/askfm.rs
@@ -0,0 +1,34 @@
1//! ASKfm — 社交 — ask.fm
2//!
3//! askfm
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// ASKfm — 社交 — ask.fm
10pub struct Askfm;
11
12impl Platform for Askfm {
13 fn id(&self) -> &'static str {
14 "askfm"
15 }
16
17 fn name(&self) -> &'static str {
18 "ASKfm"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ask.fm"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Askfm = Askfm;
Added lib/social/src/parse/asos.rs lib/social/src/parse/asos.rs +34 −0 View lib/social/src/parse/asos.rs
@@ -0,0 +1,34 @@
1//! ASOS — 电商 — asos.com
2//!
3//! asos
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// ASOS — 电商 — asos.com
10pub struct Asos;
11
12impl Platform for Asos {
13 fn id(&self) -> &'static str {
14 "asos"
15 }
16
17 fn name(&self) -> &'static str {
18 "ASOS"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["asos.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Asos = Asos;
Added lib/social/src/parse/atlassian.rs lib/social/src/parse/atlassian.rs +34 −0 View lib/social/src/parse/atlassian.rs
@@ -0,0 +1,34 @@
1//! Atlassian — 开发 — atlassian.com, atlassian.net, jira.com
2//!
3//! atlassian
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Atlassian — 开发 — atlassian.com, atlassian.net, jira.com
10pub struct Atlassian;
11
12impl Platform for Atlassian {
13 fn id(&self) -> &'static str {
14 "atlassian"
15 }
16
17 fn name(&self) -> &'static str {
18 "Atlassian"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["atlassian.com", "atlassian.net", "jira.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Atlassian = Atlassian;
Added lib/social/src/parse/audiomack.rs lib/social/src/parse/audiomack.rs +34 −0 View lib/social/src/parse/audiomack.rs
@@ -0,0 +1,34 @@
1//! Audiomack — 音乐 — audiomack.com
2//!
3//! audiomack
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Audiomack — 音乐 — audiomack.com
10pub struct Audiomack;
11
12impl Platform for Audiomack {
13 fn id(&self) -> &'static str {
14 "audiomack"
15 }
16
17 fn name(&self) -> &'static str {
18 "Audiomack"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["audiomack.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Audiomack = Audiomack;
Added lib/social/src/parse/audius.rs lib/social/src/parse/audius.rs +37 −0 View lib/social/src/parse/audius.rs
@@ -0,0 +1,37 @@
1//! Audius — 音乐 — audius.co
2//!
3//! audius
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Audius — 音乐 — audius.co
10pub struct Audius;
11
12impl Platform for Audius {
13 fn id(&self) -> &'static str {
14 "audius"
15 }
16
17 fn name(&self) -> &'static str {
18 "Audius"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["audius.co"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32 fn oembed(&self) -> Option<&'static str> {
33 Some("https://audius.co/oembed?url={url_enc}&format=json")
34 }
35}
36
37pub static PLATFORM: Audius = Audius;
Added lib/social/src/parse/awa.rs lib/social/src/parse/awa.rs +34 −0 View lib/social/src/parse/awa.rs
@@ -0,0 +1,34 @@
1//! AWA — 音乐 — awa.fm
2//!
3//! awa
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// AWA — 音乐 — awa.fm
10pub struct Awa;
11
12impl Platform for Awa {
13 fn id(&self) -> &'static str {
14 "awa"
15 }
16
17 fn name(&self) -> &'static str {
18 "AWA"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["awa.fm"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Awa = Awa;
Added lib/social/src/parse/b23.rs lib/social/src/parse/b23.rs +34 −0 View lib/social/src/parse/b23.rs
@@ -0,0 +1,34 @@
1//! B站短链 — 视频 — b23.tv, bili2233.cn
2//!
3//! b23
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// B站短链 — 视频 — b23.tv, bili2233.cn
10pub struct B23;
11
12impl Platform for B23 {
13 fn id(&self) -> &'static str {
14 "b23"
15 }
16
17 fn name(&self) -> &'static str {
18 "B站短链"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["b23.tv", "bili2233.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: B23 = B23;
Added lib/social/src/parse/badoo.rs lib/social/src/parse/badoo.rs +34 −0 View lib/social/src/parse/badoo.rs
@@ -0,0 +1,34 @@
1//! Badoo — 社交 — badoo.com
2//!
3//! badoo
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Badoo — 社交 — badoo.com
10pub struct Badoo;
11
12impl Platform for Badoo {
13 fn id(&self) -> &'static str {
14 "badoo"
15 }
16
17 fn name(&self) -> &'static str {
18 "Badoo"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["badoo.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Badoo = Badoo;
Added lib/social/src/parse/baidu.rs lib/social/src/parse/baidu.rs +34 −0 View lib/social/src/parse/baidu.rs
@@ -0,0 +1,34 @@
1//! 百度 — 新闻 — baidu.com, baidu.cn
2//!
3//! baidu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 百度 — 新闻 — baidu.com, baidu.cn
10pub struct Baidu;
11
12impl Platform for Baidu {
13 fn id(&self) -> &'static str {
14 "baidu"
15 }
16
17 fn name(&self) -> &'static str {
18 "百度"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["baidu.com", "baidu.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Baidu = Baidu;
Added lib/social/src/parse/baidu_search.rs lib/social/src/parse/baidu_search.rs +34 −0 View lib/social/src/parse/baidu_search.rs
@@ -0,0 +1,34 @@
1//! 百度搜索 — 知识 — m.baidu.com
2//!
3//! baidu-search
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 百度搜索 — 知识 — m.baidu.com
10pub struct BaiduSearch;
11
12impl Platform for BaiduSearch {
13 fn id(&self) -> &'static str {
14 "baidu-search"
15 }
16
17 fn name(&self) -> &'static str {
18 "百度搜索"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["m.baidu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: BaiduSearch = BaiduSearch;
Added lib/social/src/parse/baidumap.rs lib/social/src/parse/baidumap.rs +34 −0 View lib/social/src/parse/baidumap.rs
@@ -0,0 +1,34 @@
1//! 百度地图 — 知识 — map.baidu.com, maps.baidu.com
2//!
3//! baidumap
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 百度地图 — 知识 — map.baidu.com, maps.baidu.com
10pub struct Baidumap;
11
12impl Platform for Baidumap {
13 fn id(&self) -> &'static str {
14 "baidumap"
15 }
16
17 fn name(&self) -> &'static str {
18 "百度地图"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["map.baidu.com", "maps.baidu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Baidumap = Baidumap;
Added lib/social/src/parse/baidupan.rs lib/social/src/parse/baidupan.rs +34 −0 View lib/social/src/parse/baidupan.rs
@@ -0,0 +1,34 @@
1//! 百度网盘 — 知识 — pan.baidu.com
2//!
3//! baidupan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 百度网盘 — 知识 — pan.baidu.com
10pub struct Baidupan;
11
12impl Platform for Baidupan {
13 fn id(&self) -> &'static str {
14 "baidupan"
15 }
16
17 fn name(&self) -> &'static str {
18 "百度网盘"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pan.baidu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Baidupan = Baidupan;
Added lib/social/src/parse/baijiahao.rs lib/social/src/parse/baijiahao.rs +34 −0 View lib/social/src/parse/baijiahao.rs
@@ -0,0 +1,34 @@
1//! 百家号 — 新闻 — baijiahao.baidu.com
2//!
3//! baijiahao
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 百家号 — 新闻 — baijiahao.baidu.com
10pub struct Baijiahao;
11
12impl Platform for Baijiahao {
13 fn id(&self) -> &'static str {
14 "baijiahao"
15 }
16
17 fn name(&self) -> &'static str {
18 "百家号"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["baijiahao.baidu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Baijiahao = Baijiahao;
Added lib/social/src/parse/baike.rs lib/social/src/parse/baike.rs +34 −0 View lib/social/src/parse/baike.rs
@@ -0,0 +1,34 @@
1//! 百度百科 — 知识 — baike.baidu.com
2//!
3//! baike
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 百度百科 — 知识 — baike.baidu.com
10pub struct Baike;
11
12impl Platform for Baike {
13 fn id(&self) -> &'static str {
14 "baike"
15 }
16
17 fn name(&self) -> &'static str {
18 "百度百科"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["baike.baidu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Baike = Baike;
Added lib/social/src/parse/bandcamp.rs lib/social/src/parse/bandcamp.rs +34 −0 View lib/social/src/parse/bandcamp.rs
@@ -0,0 +1,34 @@
1//! Bandcamp — 音乐 — bandcamp.com
2//!
3//! bandcamp
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Bandcamp — 音乐 — bandcamp.com
10pub struct Bandcamp;
11
12impl Platform for Bandcamp {
13 fn id(&self) -> &'static str {
14 "bandcamp"
15 }
16
17 fn name(&self) -> &'static str {
18 "Bandcamp"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bandcamp.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bandcamp = Bandcamp;
Added lib/social/src/parse/bbc.rs lib/social/src/parse/bbc.rs +34 −0 View lib/social/src/parse/bbc.rs
@@ -0,0 +1,34 @@
1//! BBC — 新闻 — bbc.com, bbc.co.uk, bbc.in
2//!
3//! bbc
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// BBC — 新闻 — bbc.com, bbc.co.uk, bbc.in
10pub struct Bbc;
11
12impl Platform for Bbc {
13 fn id(&self) -> &'static str {
14 "bbc"
15 }
16
17 fn name(&self) -> &'static str {
18 "BBC"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bbc.com", "bbc.co.uk", "bbc.in"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bbc = Bbc;
Added lib/social/src/parse/behance.rs lib/social/src/parse/behance.rs +34 −0 View lib/social/src/parse/behance.rs
@@ -0,0 +1,34 @@
1//! Behance — 开发 — behance.net
2//!
3//! behance
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Behance — 开发 — behance.net
10pub struct Behance;
11
12impl Platform for Behance {
13 fn id(&self) -> &'static str {
14 "behance"
15 }
16
17 fn name(&self) -> &'static str {
18 "Behance"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["behance.net"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Behance = Behance;
Added lib/social/src/parse/bestbuy.rs lib/social/src/parse/bestbuy.rs +34 −0 View lib/social/src/parse/bestbuy.rs
@@ -0,0 +1,34 @@
1//! Best Buy — 电商 — bestbuy.com
2//!
3//! bestbuy
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Best Buy — 电商 — bestbuy.com
10pub struct Bestbuy;
11
12impl Platform for Bestbuy {
13 fn id(&self) -> &'static str {
14 "bestbuy"
15 }
16
17 fn name(&self) -> &'static str {
18 "Best Buy"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bestbuy.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bestbuy = Bestbuy;
Added lib/social/src/parse/bigo.rs lib/social/src/parse/bigo.rs +34 −0 View lib/social/src/parse/bigo.rs
@@ -0,0 +1,34 @@
1//! BIGO LIVE — 直播 — bigo.tv, bigolive.com
2//!
3//! bigo
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// BIGO LIVE — 直播 — bigo.tv, bigolive.com
10pub struct Bigo;
11
12impl Platform for Bigo {
13 fn id(&self) -> &'static str {
14 "bigo"
15 }
16
17 fn name(&self) -> &'static str {
18 "BIGO LIVE"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bigo.tv", "bigolive.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bigo = Bigo;
Added lib/social/src/parse/bilibili.rs lib/social/src/parse/bilibili.rs +33 −0 View lib/social/src/parse/bilibili.rs
@@ -0,0 +1,33 @@
1//! 哔哩哔哩 — 视频 — bilibili.com, bilibili.tv
2//!
3//! bilibili
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// 哔哩哔哩 — 视频 — bilibili.com, bilibili.tv
9pub struct Bilibili;
10
11impl Platform for Bilibili {
12 fn id(&self) -> &'static str {
13 "bilibili"
14 }
15
16 fn name(&self) -> &'static str {
17 "哔哩哔哩"
18 }
19
20 fn category(&self) -> Category {
21 Category::Video
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["bilibili.com", "bilibili.tv"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide("^/video/(BV[A-Za-z0-9]+)", "https://player.bilibili.com/player.html?bvid={id}&autoplay=0"))
30 }
31}
32
33pub static PLATFORM: Bilibili = Bilibili;
Added lib/social/src/parse/bilibili_live.rs lib/social/src/parse/bilibili_live.rs +33 −0 View lib/social/src/parse/bilibili_live.rs
@@ -0,0 +1,33 @@
1//! 哔哩哔哩直播 — 直播 — live.bilibili.com
2//!
3//! bilibili-live
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// 哔哩哔哩直播 — 直播 — live.bilibili.com
9pub struct BilibiliLive;
10
11impl Platform for BilibiliLive {
12 fn id(&self) -> &'static str {
13 "bilibili-live"
14 }
15
16 fn name(&self) -> &'static str {
17 "哔哩哔哩直播"
18 }
19
20 fn category(&self) -> Category {
21 Category::Live
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["live.bilibili.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide(r"^/(\d+)", "https://live.bilibili.com/blackboard/live/live-iframe.html?roomId={id}"))
30 }
31}
32
33pub static PLATFORM: BilibiliLive = BilibiliLive;
Added lib/social/src/parse/bitbucket.rs lib/social/src/parse/bitbucket.rs +34 −0 View lib/social/src/parse/bitbucket.rs
@@ -0,0 +1,34 @@
1//! Bitbucket — 开发 — bitbucket.org, bitbucket.io
2//!
3//! bitbucket
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Bitbucket — 开发 — bitbucket.org, bitbucket.io
10pub struct Bitbucket;
11
12impl Platform for Bitbucket {
13 fn id(&self) -> &'static str {
14 "bitbucket"
15 }
16
17 fn name(&self) -> &'static str {
18 "Bitbucket"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bitbucket.org", "bitbucket.io"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bitbucket = Bitbucket;
Added lib/social/src/parse/bitchute.rs lib/social/src/parse/bitchute.rs +34 −0 View lib/social/src/parse/bitchute.rs
@@ -0,0 +1,34 @@
1//! BitChute — 视频 — bitchute.com
2//!
3//! bitchute
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// BitChute — 视频 — bitchute.com
10pub struct Bitchute;
11
12impl Platform for Bitchute {
13 fn id(&self) -> &'static str {
14 "bitchute"
15 }
16
17 fn name(&self) -> &'static str {
18 "BitChute"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bitchute.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bitchute = Bitchute;
Added lib/social/src/parse/bloomberg.rs lib/social/src/parse/bloomberg.rs +34 −0 View lib/social/src/parse/bloomberg.rs
@@ -0,0 +1,34 @@
1//! Bloomberg — 新闻 — bloomberg.com, bloom.bg
2//!
3//! bloomberg
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Bloomberg — 新闻 — bloomberg.com, bloom.bg
10pub struct Bloomberg;
11
12impl Platform for Bloomberg {
13 fn id(&self) -> &'static str {
14 "bloomberg"
15 }
16
17 fn name(&self) -> &'static str {
18 "Bloomberg"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bloomberg.com", "bloom.bg"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bloomberg = Bloomberg;
Added lib/social/src/parse/bluesky.rs lib/social/src/parse/bluesky.rs +34 −0 View lib/social/src/parse/bluesky.rs
@@ -0,0 +1,34 @@
1//! Bluesky — 社交 — bsky.app, bsky.social
2//!
3//! bluesky
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Bluesky — 社交 — bsky.app, bsky.social
10pub struct Bluesky;
11
12impl Platform for Bluesky {
13 fn id(&self) -> &'static str {
14 "bluesky"
15 }
16
17 fn name(&self) -> &'static str {
18 "Bluesky"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bsky.app", "bsky.social"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bluesky = Bluesky;
Added lib/social/src/parse/booking.rs lib/social/src/parse/booking.rs +34 −0 View lib/social/src/parse/booking.rs
@@ -0,0 +1,34 @@
1//! Booking.com — 电商 — booking.com
2//!
3//! booking
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Booking.com — 电商 — booking.com
10pub struct Booking;
11
12impl Platform for Booking {
13 fn id(&self) -> &'static str {
14 "booking"
15 }
16
17 fn name(&self) -> &'static str {
18 "Booking.com"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["booking.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Booking = Booking;
Added lib/social/src/parse/boomplay.rs lib/social/src/parse/boomplay.rs +34 −0 View lib/social/src/parse/boomplay.rs
@@ -0,0 +1,34 @@
1//! Boomplay — 音乐 — boomplay.com
2//!
3//! boomplay
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Boomplay — 音乐 — boomplay.com
10pub struct Boomplay;
11
12impl Platform for Boomplay {
13 fn id(&self) -> &'static str {
14 "boomplay"
15 }
16
17 fn name(&self) -> &'static str {
18 "Boomplay"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["boomplay.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Boomplay = Boomplay;
Added lib/social/src/parse/britannica.rs lib/social/src/parse/britannica.rs +34 −0 View lib/social/src/parse/britannica.rs
@@ -0,0 +1,34 @@
1//! Encyclopædia Britannica — 知识 — britannica.com
2//!
3//! britannica
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Encyclopædia Britannica — 知识 — britannica.com
10pub struct Britannica;
11
12impl Platform for Britannica {
13 fn id(&self) -> &'static str {
14 "britannica"
15 }
16
17 fn name(&self) -> &'static str {
18 "Encyclopædia Britannica"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["britannica.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Britannica = Britannica;
Added lib/social/src/parse/bumble.rs lib/social/src/parse/bumble.rs +34 −0 View lib/social/src/parse/bumble.rs
@@ -0,0 +1,34 @@
1//! Bumble — 社交 — bumble.com
2//!
3//! bumble
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Bumble — 社交 — bumble.com
10pub struct Bumble;
11
12impl Platform for Bumble {
13 fn id(&self) -> &'static str {
14 "bumble"
15 }
16
17 fn name(&self) -> &'static str {
18 "Bumble"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["bumble.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Bumble = Bumble;
Added lib/social/src/parse/caixin.rs lib/social/src/parse/caixin.rs +34 −0 View lib/social/src/parse/caixin.rs
@@ -0,0 +1,34 @@
1//! 财新 — 新闻 — caixin.com, caixin.cn
2//!
3//! caixin
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 财新 — 新闻 — caixin.com, caixin.cn
10pub struct Caixin;
11
12impl Platform for Caixin {
13 fn id(&self) -> &'static str {
14 "caixin"
15 }
16
17 fn name(&self) -> &'static str {
18 "财新"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["caixin.com", "caixin.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Caixin = Caixin;
Added lib/social/src/parse/canva.rs lib/social/src/parse/canva.rs +34 −0 View lib/social/src/parse/canva.rs
@@ -0,0 +1,34 @@
1//! Canva — 开发 — canva.com, canva.cn
2//!
3//! canva
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Canva — 开发 — canva.com, canva.cn
10pub struct Canva;
11
12impl Platform for Canva {
13 fn id(&self) -> &'static str {
14 "canva"
15 }
16
17 fn name(&self) -> &'static str {
18 "Canva"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["canva.com", "canva.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Canva = Canva;
Added lib/social/src/parse/cctv.rs lib/social/src/parse/cctv.rs +34 −0 View lib/social/src/parse/cctv.rs
@@ -0,0 +1,34 @@
1//! 央视网 — 新闻 — cctv.com, cntv.cn, cctv.cn, yangshipin.cn
2//!
3//! cctv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 央视网 — 新闻 — cctv.com, cntv.cn, cctv.cn, yangshipin.cn
10pub struct Cctv;
11
12impl Platform for Cctv {
13 fn id(&self) -> &'static str {
14 "cctv"
15 }
16
17 fn name(&self) -> &'static str {
18 "央视网"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["cctv.com", "cntv.cn", "cctv.cn", "yangshipin.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Cctv = Cctv;
Added lib/social/src/parse/cell.rs lib/social/src/parse/cell.rs +34 −0 View lib/social/src/parse/cell.rs
@@ -0,0 +1,34 @@
1//! Cell — 知识 — cell.com
2//!
3//! cell
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Cell — 知识 — cell.com
10pub struct Cell;
11
12impl Platform for Cell {
13 fn id(&self) -> &'static str {
14 "cell"
15 }
16
17 fn name(&self) -> &'static str {
18 "Cell"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["cell.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Cell = Cell;
Added lib/social/src/parse/changba.rs lib/social/src/parse/changba.rs +34 −0 View lib/social/src/parse/changba.rs
@@ -0,0 +1,34 @@
1//! 唱吧 — 音乐 — changba.com
2//!
3//! changba
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 唱吧 — 音乐 — changba.com
10pub struct Changba;
11
12impl Platform for Changba {
13 fn id(&self) -> &'static str {
14 "changba"
15 }
16
17 fn name(&self) -> &'static str {
18 "唱吧"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["changba.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Changba = Changba;
Added lib/social/src/parse/chinanews.rs lib/social/src/parse/chinanews.rs +34 −0 View lib/social/src/parse/chinanews.rs
@@ -0,0 +1,34 @@
1//! 中国新闻网 — 新闻 — chinanews.com, chinanews.com.cn
2//!
3//! chinanews
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 中国新闻网 — 新闻 — chinanews.com, chinanews.com.cn
10pub struct Chinanews;
11
12impl Platform for Chinanews {
13 fn id(&self) -> &'static str {
14 "chinanews"
15 }
16
17 fn name(&self) -> &'static str {
18 "中国新闻网"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["chinanews.com", "chinanews.com.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Chinanews = Chinanews;
Added lib/social/src/parse/cloudflare.rs lib/social/src/parse/cloudflare.rs +34 −0 View lib/social/src/parse/cloudflare.rs
@@ -0,0 +1,34 @@
1//! Cloudflare — 开发 — cloudflare.com, workers.dev, pages.dev
2//!
3//! cloudflare
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Cloudflare — 开发 — cloudflare.com, workers.dev, pages.dev
10pub struct Cloudflare;
11
12impl Platform for Cloudflare {
13 fn id(&self) -> &'static str {
14 "cloudflare"
15 }
16
17 fn name(&self) -> &'static str {
18 "Cloudflare"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["cloudflare.com", "workers.dev", "pages.dev"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Cloudflare = Cloudflare;
Added lib/social/src/parse/cls.rs lib/social/src/parse/cls.rs +34 −0 View lib/social/src/parse/cls.rs
@@ -0,0 +1,34 @@
1//! 财联社 — 新闻 — cls.cn
2//!
3//! cls
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 财联社 — 新闻 — cls.cn
10pub struct Cls;
11
12impl Platform for Cls {
13 fn id(&self) -> &'static str {
14 "cls"
15 }
16
17 fn name(&self) -> &'static str {
18 "财联社"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["cls.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Cls = Cls;
Added lib/social/src/parse/clubhouse.rs lib/social/src/parse/clubhouse.rs +34 −0 View lib/social/src/parse/clubhouse.rs
@@ -0,0 +1,34 @@
1//! Clubhouse — 社交 — clubhouse.com
2//!
3//! clubhouse
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Clubhouse — 社交 — clubhouse.com
10pub struct Clubhouse;
11
12impl Platform for Clubhouse {
13 fn id(&self) -> &'static str {
14 "clubhouse"
15 }
16
17 fn name(&self) -> &'static str {
18 "Clubhouse"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["clubhouse.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Clubhouse = Clubhouse;
Added lib/social/src/parse/cnblogs.rs lib/social/src/parse/cnblogs.rs +34 −0 View lib/social/src/parse/cnblogs.rs
@@ -0,0 +1,34 @@
1//! 博客园 — 开发 — cnblogs.com
2//!
3//! cnblogs
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 博客园 — 开发 — cnblogs.com
10pub struct Cnblogs;
11
12impl Platform for Cnblogs {
13 fn id(&self) -> &'static str {
14 "cnblogs"
15 }
16
17 fn name(&self) -> &'static str {
18 "博客园"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["cnblogs.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Cnblogs = Cnblogs;
Added lib/social/src/parse/cnn.rs lib/social/src/parse/cnn.rs +34 −0 View lib/social/src/parse/cnn.rs
@@ -0,0 +1,34 @@
1//! CNN — 新闻 — cnn.com, cnn.it
2//!
3//! cnn
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// CNN — 新闻 — cnn.com, cnn.it
10pub struct Cnn;
11
12impl Platform for Cnn {
13 fn id(&self) -> &'static str {
14 "cnn"
15 }
16
17 fn name(&self) -> &'static str {
18 "CNN"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["cnn.com", "cnn.it"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Cnn = Cnn;
Added lib/social/src/parse/codepen.rs lib/social/src/parse/codepen.rs +33 −0 View lib/social/src/parse/codepen.rs
@@ -0,0 +1,33 @@
1//! CodePen — 开发 — codepen.io
2//!
3//! codepen
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// CodePen — 开发 — codepen.io
9pub struct Codepen;
10
11impl Platform for Codepen {
12 fn id(&self) -> &'static str {
13 "codepen"
14 }
15
16 fn name(&self) -> &'static str {
17 "CodePen"
18 }
19
20 fn category(&self) -> Category {
21 Category::Dev
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["codepen.io"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide("^/([^/]+)/pen/([A-Za-z0-9]+)", "https://codepen.io/{1}/embed/{2}?default-tab=result"))
30 }
31}
32
33pub static PLATFORM: Codepen = Codepen;
Added lib/social/src/parse/codesandbox.rs lib/social/src/parse/codesandbox.rs +33 −0 View lib/social/src/parse/codesandbox.rs
@@ -0,0 +1,33 @@
1//! CodeSandbox — 开发 — codesandbox.io
2//!
3//! codesandbox
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// CodeSandbox — 开发 — codesandbox.io
9pub struct Codesandbox;
10
11impl Platform for Codesandbox {
12 fn id(&self) -> &'static str {
13 "codesandbox"
14 }
15
16 fn name(&self) -> &'static str {
17 "CodeSandbox"
18 }
19
20 fn category(&self) -> Category {
21 Category::Dev
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["codesandbox.io"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://codesandbox.io/embed{path}"))
30 }
31}
32
33pub static PLATFORM: Codesandbox = Codesandbox;
Added lib/social/src/parse/colab.rs lib/social/src/parse/colab.rs +34 −0 View lib/social/src/parse/colab.rs
@@ -0,0 +1,34 @@
1//! Google Colab — 开发 — colab.research.google.com
2//!
3//! colab
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Google Colab — 开发 — colab.research.google.com
10pub struct Colab;
11
12impl Platform for Colab {
13 fn id(&self) -> &'static str {
14 "colab"
15 }
16
17 fn name(&self) -> &'static str {
18 "Google Colab"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["colab.research.google.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Colab = Colab;
Added lib/social/src/parse/coolapk.rs lib/social/src/parse/coolapk.rs +34 −0 View lib/social/src/parse/coolapk.rs
@@ -0,0 +1,34 @@
1//! 酷安 — 论坛 — coolapk.com, coolapkmarket.com
2//!
3//! coolapk
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 酷安 — 论坛 — coolapk.com, coolapkmarket.com
10pub struct Coolapk;
11
12impl Platform for Coolapk {
13 fn id(&self) -> &'static str {
14 "coolapk"
15 }
16
17 fn name(&self) -> &'static str {
18 "酷安"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["coolapk.com", "coolapkmarket.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Coolapk = Coolapk;
Added lib/social/src/parse/costco.rs lib/social/src/parse/costco.rs +34 −0 View lib/social/src/parse/costco.rs
@@ -0,0 +1,34 @@
1//! Costco — 电商 — costco.com
2//!
3//! costco
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Costco — 电商 — costco.com
10pub struct Costco;
11
12impl Platform for Costco {
13 fn id(&self) -> &'static str {
14 "costco"
15 }
16
17 fn name(&self) -> &'static str {
18 "Costco"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["costco.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Costco = Costco;
Added lib/social/src/parse/coupang.rs lib/social/src/parse/coupang.rs +34 −0 View lib/social/src/parse/coupang.rs
@@ -0,0 +1,34 @@
1//! Coupang — 电商 — coupang.com
2//!
3//! coupang
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Coupang — 电商 — coupang.com
10pub struct Coupang;
11
12impl Platform for Coupang {
13 fn id(&self) -> &'static str {
14 "coupang"
15 }
16
17 fn name(&self) -> &'static str {
18 "Coupang"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["coupang.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Coupang = Coupang;
Added lib/social/src/parse/cratesio.rs lib/social/src/parse/cratesio.rs +34 −0 View lib/social/src/parse/cratesio.rs
@@ -0,0 +1,34 @@
1//! crates.io — 开发 — crates.io
2//!
3//! cratesio
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// crates.io — 开发 — crates.io
10pub struct Cratesio;
11
12impl Platform for Cratesio {
13 fn id(&self) -> &'static str {
14 "cratesio"
15 }
16
17 fn name(&self) -> &'static str {
18 "crates.io"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["crates.io"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Cratesio = Cratesio;
Added lib/social/src/parse/crunchyroll.rs lib/social/src/parse/crunchyroll.rs +34 −0 View lib/social/src/parse/crunchyroll.rs
@@ -0,0 +1,34 @@
1//! Crunchyroll — 视频 — crunchyroll.com
2//!
3//! crunchyroll
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Crunchyroll — 视频 — crunchyroll.com
10pub struct Crunchyroll;
11
12impl Platform for Crunchyroll {
13 fn id(&self) -> &'static str {
14 "crunchyroll"
15 }
16
17 fn name(&self) -> &'static str {
18 "Crunchyroll"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["crunchyroll.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Crunchyroll = Crunchyroll;
Added lib/social/src/parse/csdn.rs lib/social/src/parse/csdn.rs +34 −0 View lib/social/src/parse/csdn.rs
@@ -0,0 +1,34 @@
1//! CSDN — 开发 — csdn.net, blog.csdn.net
2//!
3//! csdn
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// CSDN — 开发 — csdn.net, blog.csdn.net
10pub struct Csdn;
11
12impl Platform for Csdn {
13 fn id(&self) -> &'static str {
14 "csdn"
15 }
16
17 fn name(&self) -> &'static str {
18 "CSDN"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["csdn.net", "blog.csdn.net"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Csdn = Csdn;
Added lib/social/src/parse/ctrip.rs lib/social/src/parse/ctrip.rs +34 −0 View lib/social/src/parse/ctrip.rs
@@ -0,0 +1,34 @@
1//! 携程 — 电商 — ctrip.com, trip.com
2//!
3//! ctrip
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 携程 — 电商 — ctrip.com, trip.com
10pub struct Ctrip;
11
12impl Platform for Ctrip {
13 fn id(&self) -> &'static str {
14 "ctrip"
15 }
16
17 fn name(&self) -> &'static str {
18 "携程"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ctrip.com", "trip.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ctrip = Ctrip;
Added lib/social/src/parse/dailymotion.rs lib/social/src/parse/dailymotion.rs +33 −0 View lib/social/src/parse/dailymotion.rs
@@ -0,0 +1,33 @@
1//! Dailymotion — 视频 — dailymotion.com, dai.ly
2//!
3//! dailymotion
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Dailymotion — 视频 — dailymotion.com, dai.ly
9pub struct Dailymotion;
10
11impl Platform for Dailymotion {
12 fn id(&self) -> &'static str {
13 "dailymotion"
14 }
15
16 fn name(&self) -> &'static str {
17 "Dailymotion"
18 }
19
20 fn category(&self) -> Category {
21 Category::Video
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["dailymotion.com", "dai.ly"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide("^/video/([A-Za-z0-9]+)", "https://www.dailymotion.com/embed/video/{id}"))
30 }
31}
32
33pub static PLATFORM: Dailymotion = Dailymotion;
Added lib/social/src/parse/dangdang.rs lib/social/src/parse/dangdang.rs +34 −0 View lib/social/src/parse/dangdang.rs
@@ -0,0 +1,34 @@
1//! 当当 — 电商 — dangdang.com
2//!
3//! dangdang
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 当当 — 电商 — dangdang.com
10pub struct Dangdang;
11
12impl Platform for Dangdang {
13 fn id(&self) -> &'static str {
14 "dangdang"
15 }
16
17 fn name(&self) -> &'static str {
18 "当当"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["dangdang.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Dangdang = Dangdang;
Added lib/social/src/parse/datadog.rs lib/social/src/parse/datadog.rs +34 −0 View lib/social/src/parse/datadog.rs
@@ -0,0 +1,34 @@
1//! Datadog — 开发 — datadoghq.com
2//!
3//! datadog
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Datadog — 开发 — datadoghq.com
10pub struct Datadog;
11
12impl Platform for Datadog {
13 fn id(&self) -> &'static str {
14 "datadog"
15 }
16
17 fn name(&self) -> &'static str {
18 "Datadog"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["datadoghq.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Datadog = Datadog;
Added lib/social/src/parse/debian.rs lib/social/src/parse/debian.rs +34 −0 View lib/social/src/parse/debian.rs
@@ -0,0 +1,34 @@
1//! Debian — 开发 — debian.org
2//!
3//! debian
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Debian — 开发 — debian.org
10pub struct Debian;
11
12impl Platform for Debian {
13 fn id(&self) -> &'static str {
14 "debian"
15 }
16
17 fn name(&self) -> &'static str {
18 "Debian"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["debian.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Debian = Debian;
Added lib/social/src/parse/dedao.rs lib/social/src/parse/dedao.rs +34 −0 View lib/social/src/parse/dedao.rs
@@ -0,0 +1,34 @@
1//! 得到 — 音乐 — dedao.cn, luojilab.com
2//!
3//! dedao
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 得到 — 音乐 — dedao.cn, luojilab.com
10pub struct Dedao;
11
12impl Platform for Dedao {
13 fn id(&self) -> &'static str {
14 "dedao"
15 }
16
17 fn name(&self) -> &'static str {
18 "得到"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["dedao.cn", "luojilab.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Dedao = Dedao;
Added lib/social/src/parse/deezer.rs lib/social/src/parse/deezer.rs +33 −0 View lib/social/src/parse/deezer.rs
@@ -0,0 +1,33 @@
1//! Deezer — 音乐 — deezer.com, deezer.page.link
2//!
3//! deezer
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Deezer — 音乐 — deezer.com, deezer.page.link
9pub struct Deezer;
10
11impl Platform for Deezer {
12 fn id(&self) -> &'static str {
13 "deezer"
14 }
15
16 fn name(&self) -> &'static str {
17 "Deezer"
18 }
19
20 fn category(&self) -> Category {
21 Category::Music
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["deezer.com", "deezer.page.link"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide(r"^/(?:[a-z]{2}/)?(track|album|playlist|artist)/(\d+)", "https://widget.deezer.com/widget/dark/{1}/{2}"))
30 }
31}
32
33pub static PLATFORM: Deezer = Deezer;
Added lib/social/src/parse/devto.rs lib/social/src/parse/devto.rs +34 −0 View lib/social/src/parse/devto.rs
@@ -0,0 +1,34 @@
1//! DEV Community — 开发 — dev.to
2//!
3//! devto
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// DEV Community — 开发 — dev.to
10pub struct Devto;
11
12impl Platform for Devto {
13 fn id(&self) -> &'static str {
14 "devto"
15 }
16
17 fn name(&self) -> &'static str {
18 "DEV Community"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["dev.to"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Devto = Devto;
Added lib/social/src/parse/dewu.rs lib/social/src/parse/dewu.rs +34 −0 View lib/social/src/parse/dewu.rs
@@ -0,0 +1,34 @@
1//! 得物 — 电商 — dewu.com, poizon.com
2//!
3//! dewu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 得物 — 电商 — dewu.com, poizon.com
10pub struct Dewu;
11
12impl Platform for Dewu {
13 fn id(&self) -> &'static str {
14 "dewu"
15 }
16
17 fn name(&self) -> &'static str {
18 "得物"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["dewu.com", "poizon.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Dewu = Dewu;
Added lib/social/src/parse/digg.rs lib/social/src/parse/digg.rs +34 −0 View lib/social/src/parse/digg.rs
@@ -0,0 +1,34 @@
1//! Digg — 论坛 — digg.com
2//!
3//! digg
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Digg — 论坛 — digg.com
10pub struct Digg;
11
12impl Platform for Digg {
13 fn id(&self) -> &'static str {
14 "digg"
15 }
16
17 fn name(&self) -> &'static str {
18 "Digg"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["digg.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Digg = Digg;
Added lib/social/src/parse/dingtalk.rs lib/social/src/parse/dingtalk.rs +34 −0 View lib/social/src/parse/dingtalk.rs
@@ -0,0 +1,34 @@
1//! 钉钉 — 社交 — dingtalk.com, dingtalk.cn, dingtalkapps.com
2//!
3//! dingtalk
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 钉钉 — 社交 — dingtalk.com, dingtalk.cn, dingtalkapps.com
10pub struct Dingtalk;
11
12impl Platform for Dingtalk {
13 fn id(&self) -> &'static str {
14 "dingtalk"
15 }
16
17 fn name(&self) -> &'static str {
18 "钉钉"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["dingtalk.com", "dingtalk.cn", "dingtalkapps.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Dingtalk = Dingtalk;
Added lib/social/src/parse/discord.rs lib/social/src/parse/discord.rs +34 −0 View lib/social/src/parse/discord.rs
@@ -0,0 +1,34 @@
1//! Discord — 社交 — discord.com, discordapp.com
2//!
3//! discord
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Discord — 社交 — discord.com, discordapp.com
10pub struct Discord;
11
12impl Platform for Discord {
13 fn id(&self) -> &'static str {
14 "discord"
15 }
16
17 fn name(&self) -> &'static str {
18 "Discord"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["discord.com", "discordapp.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Discord = Discord;
Added lib/social/src/parse/discord_invite.rs lib/social/src/parse/discord_invite.rs +33 −0 View lib/social/src/parse/discord_invite.rs
@@ -0,0 +1,33 @@
1//! Discord 邀请 — 社交 — discord.gg
2//!
3//! discord-invite
4//!
5//! 站点不允许内嵌,渲染成带平台标识的卡片。
6//! 邀请码不是服务器 ID,discord.com/widget?id= 需要 guild id,用邀请码拼出的
7//! widget iframe 只会显示空白,因此这里不做嵌入。
8
9use crate::parse::Platform;
10use crate::Category;
11
12/// Discord 邀请 — 社交 — discord.gg
13pub struct DiscordInvite;
14
15impl Platform for DiscordInvite {
16 fn id(&self) -> &'static str {
17 "discord-invite"
18 }
19
20 fn name(&self) -> &'static str {
21 "Discord 邀请"
22 }
23
24 fn category(&self) -> Category {
25 Category::Social
26 }
27
28 fn domains(&self) -> &'static [&'static str] {
29 &["discord.gg"]
30 }
31}
32
33pub static PLATFORM: DiscordInvite = DiscordInvite;
No newline at end of file
Added lib/social/src/parse/discourse.rs lib/social/src/parse/discourse.rs +34 −0 View lib/social/src/parse/discourse.rs
@@ -0,0 +1,34 @@
1//! Discourse — 论坛 — discourse.org
2//!
3//! discourse
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Discourse — 论坛 — discourse.org
10pub struct Discourse;
11
12impl Platform for Discourse {
13 fn id(&self) -> &'static str {
14 "discourse"
15 }
16
17 fn name(&self) -> &'static str {
18 "Discourse"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["discourse.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Discourse = Discourse;
Added lib/social/src/parse/discuz.rs lib/social/src/parse/discuz.rs +34 −0 View lib/social/src/parse/discuz.rs
@@ -0,0 +1,34 @@
1//! Discuz — 论坛 — discuz.net, discuz.com
2//!
3//! discuz
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Discuz — 论坛 — discuz.net, discuz.com
10pub struct Discuz;
11
12impl Platform for Discuz {
13 fn id(&self) -> &'static str {
14 "discuz"
15 }
16
17 fn name(&self) -> &'static str {
18 "Discuz"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["discuz.net", "discuz.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Discuz = Discuz;
Added lib/social/src/parse/disneyplus.rs lib/social/src/parse/disneyplus.rs +34 −0 View lib/social/src/parse/disneyplus.rs
@@ -0,0 +1,34 @@
1//! Disney+ — 视频 — disneyplus.com
2//!
3//! disneyplus
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Disney+ — 视频 — disneyplus.com
10pub struct Disneyplus;
11
12impl Platform for Disneyplus {
13 fn id(&self) -> &'static str {
14 "disneyplus"
15 }
16
17 fn name(&self) -> &'static str {
18 "Disney+"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["disneyplus.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Disneyplus = Disneyplus;
Added lib/social/src/parse/dlive.rs lib/social/src/parse/dlive.rs +34 −0 View lib/social/src/parse/dlive.rs
@@ -0,0 +1,34 @@
1//! DLive — 直播 — dlive.tv
2//!
3//! dlive
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// DLive — 直播 — dlive.tv
10pub struct Dlive;
11
12impl Platform for Dlive {
13 fn id(&self) -> &'static str {
14 "dlive"
15 }
16
17 fn name(&self) -> &'static str {
18 "DLive"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["dlive.tv"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Dlive = Dlive;
Added lib/social/src/parse/dockerhub.rs lib/social/src/parse/dockerhub.rs +34 −0 View lib/social/src/parse/dockerhub.rs
@@ -0,0 +1,34 @@
1//! Docker Hub — 开发 — hub.docker.com
2//!
3//! dockerhub
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Docker Hub — 开发 — hub.docker.com
10pub struct Dockerhub;
11
12impl Platform for Dockerhub {
13 fn id(&self) -> &'static str {
14 "dockerhub"
15 }
16
17 fn name(&self) -> &'static str {
18 "Docker Hub"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["hub.docker.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Dockerhub = Dockerhub;
Added lib/social/src/parse/docsrs.rs lib/social/src/parse/docsrs.rs +34 −0 View lib/social/src/parse/docsrs.rs
@@ -0,0 +1,34 @@
1//! docs.rs — 开发 — docs.rs
2//!
3//! docsrs
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// docs.rs — 开发 — docs.rs
10pub struct Docsrs;
11
12impl Platform for Docsrs {
13 fn id(&self) -> &'static str {
14 "docsrs"
15 }
16
17 fn name(&self) -> &'static str {
18 "docs.rs"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["docs.rs"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Docsrs = Docsrs;
Added lib/social/src/parse/doi.rs lib/social/src/parse/doi.rs +34 −0 View lib/social/src/parse/doi.rs
@@ -0,0 +1,34 @@
1//! DOI — 知识 — doi.org, dx.doi.org
2//!
3//! doi
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// DOI — 知识 — doi.org, dx.doi.org
10pub struct Doi;
11
12impl Platform for Doi {
13 fn id(&self) -> &'static str {
14 "doi"
15 }
16
17 fn name(&self) -> &'static str {
18 "DOI"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["doi.org", "dx.doi.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Doi = Doi;
Added lib/social/src/parse/doordash.rs lib/social/src/parse/doordash.rs +34 −0 View lib/social/src/parse/doordash.rs
@@ -0,0 +1,34 @@
1//! DoorDash — 电商 — doordash.com
2//!
3//! doordash
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// DoorDash — 电商 — doordash.com
10pub struct Doordash;
11
12impl Platform for Doordash {
13 fn id(&self) -> &'static str {
14 "doordash"
15 }
16
17 fn name(&self) -> &'static str {
18 "DoorDash"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["doordash.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Doordash = Doordash;
Added lib/social/src/parse/douban.rs lib/social/src/parse/douban.rs +34 −0 View lib/social/src/parse/douban.rs
@@ -0,0 +1,34 @@
1//! 豆瓣 — 社交 — douban.com
2//!
3//! douban
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 豆瓣 — 社交 — douban.com
10pub struct Douban;
11
12impl Platform for Douban {
13 fn id(&self) -> &'static str {
14 "douban"
15 }
16
17 fn name(&self) -> &'static str {
18 "豆瓣"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["douban.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Douban = Douban;
Added lib/social/src/parse/douban_book.rs lib/social/src/parse/douban_book.rs +34 −0 View lib/social/src/parse/douban_book.rs
@@ -0,0 +1,34 @@
1//! 豆瓣读书 — 知识 — book.douban.com
2//!
3//! douban-book
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 豆瓣读书 — 知识 — book.douban.com
10pub struct DoubanBook;
11
12impl Platform for DoubanBook {
13 fn id(&self) -> &'static str {
14 "douban-book"
15 }
16
17 fn name(&self) -> &'static str {
18 "豆瓣读书"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["book.douban.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: DoubanBook = DoubanBook;
Added lib/social/src/parse/douban_movie.rs lib/social/src/parse/douban_movie.rs +34 −0 View lib/social/src/parse/douban_movie.rs
@@ -0,0 +1,34 @@
1//! 豆瓣电影 — 知识 — movie.douban.com
2//!
3//! douban-movie
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 豆瓣电影 — 知识 — movie.douban.com
10pub struct DoubanMovie;
11
12impl Platform for DoubanMovie {
13 fn id(&self) -> &'static str {
14 "douban-movie"
15 }
16
17 fn name(&self) -> &'static str {
18 "豆瓣电影"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["movie.douban.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: DoubanMovie = DoubanMovie;
Added lib/social/src/parse/douyin.rs lib/social/src/parse/douyin.rs +33 −0 View lib/social/src/parse/douyin.rs
@@ -0,0 +1,33 @@
1//! 抖音 — 社交 — douyin.com, iesdouyin.com
2//!
3//! douyin
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// 抖音 — 社交 — douyin.com, iesdouyin.com
9pub struct Douyin;
10
11impl Platform for Douyin {
12 fn id(&self) -> &'static str {
13 "douyin"
14 }
15
16 fn name(&self) -> &'static str {
17 "抖音"
18 }
19
20 fn category(&self) -> Category {
21 Category::Social
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["douyin.com", "iesdouyin.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::vertical(r"^/video/(\d+)", "https://open.douyin.com/player/video?vid={id}&autoplay=0"))
30 }
31}
32
33pub static PLATFORM: Douyin = Douyin;
Added lib/social/src/parse/douyin_live.rs lib/social/src/parse/douyin_live.rs +34 −0 View lib/social/src/parse/douyin_live.rs
@@ -0,0 +1,34 @@
1//! 抖音直播 — 直播 — live.douyin.com
2//!
3//! douyin-live
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 抖音直播 — 直播 — live.douyin.com
10pub struct DouyinLive;
11
12impl Platform for DouyinLive {
13 fn id(&self) -> &'static str {
14 "douyin-live"
15 }
16
17 fn name(&self) -> &'static str {
18 "抖音直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["live.douyin.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: DouyinLive = DouyinLive;
Added lib/social/src/parse/douyu.rs lib/social/src/parse/douyu.rs +34 −0 View lib/social/src/parse/douyu.rs
@@ -0,0 +1,34 @@
1//! 斗鱼 — 直播 — douyu.com
2//!
3//! douyu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 斗鱼 — 直播 — douyu.com
10pub struct Douyu;
11
12impl Platform for Douyu {
13 fn id(&self) -> &'static str {
14 "douyu"
15 }
16
17 fn name(&self) -> &'static str {
18 "斗鱼"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["douyu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Douyu = Douyu;
Added lib/social/src/parse/dribbble.rs lib/social/src/parse/dribbble.rs +34 −0 View lib/social/src/parse/dribbble.rs
@@ -0,0 +1,34 @@
1//! Dribbble — 开发 — dribbble.com
2//!
3//! dribbble
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Dribbble — 开发 — dribbble.com
10pub struct Dribbble;
11
12impl Platform for Dribbble {
13 fn id(&self) -> &'static str {
14 "dribbble"
15 }
16
17 fn name(&self) -> &'static str {
18 "Dribbble"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["dribbble.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Dribbble = Dribbble;
Added lib/social/src/parse/eastmoney.rs lib/social/src/parse/eastmoney.rs +34 −0 View lib/social/src/parse/eastmoney.rs
@@ -0,0 +1,34 @@
1//! 东方财富 — 新闻 — eastmoney.com
2//!
3//! eastmoney
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 东方财富 — 新闻 — eastmoney.com
10pub struct Eastmoney;
11
12impl Platform for Eastmoney {
13 fn id(&self) -> &'static str {
14 "eastmoney"
15 }
16
17 fn name(&self) -> &'static str {
18 "东方财富"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["eastmoney.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Eastmoney = Eastmoney;
Added lib/social/src/parse/ebay.rs lib/social/src/parse/ebay.rs +34 −0 View lib/social/src/parse/ebay.rs
@@ -0,0 +1,34 @@
1//! eBay — 电商 — ebay.com, ebay.co.uk, ebay.de, ebay.fr, ebay.com.au, ebay.ca, ebay.it, ebay.es, ebay.com.hk, ebay.com.sg, ebay.ph, ebay.com.my, ebay.ie, ebay.nl, ebay.at, ebay.ch, ebay.com.tw
2//!
3//! ebay
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// eBay — 电商 — ebay.com, ebay.co.uk, ebay.de, ebay.fr, ebay.com.au, ebay.ca, ebay.it, ebay.es, ebay.com.hk, ebay.com.sg, ebay.ph, ebay.com.my, ebay.ie, ebay.nl, ebay.at, ebay.ch, ebay.com.tw
10pub struct Ebay;
11
12impl Platform for Ebay {
13 fn id(&self) -> &'static str {
14 "ebay"
15 }
16
17 fn name(&self) -> &'static str {
18 "eBay"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ebay.com", "ebay.co.uk", "ebay.de", "ebay.fr", "ebay.com.au", "ebay.ca", "ebay.it", "ebay.es", "ebay.com.hk", "ebay.com.sg", "ebay.ph", "ebay.com.my", "ebay.ie", "ebay.nl", "ebay.at", "ebay.ch", "ebay.com.tw"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ebay = Ebay;
Added lib/social/src/parse/elastic.rs lib/social/src/parse/elastic.rs +34 −0 View lib/social/src/parse/elastic.rs
@@ -0,0 +1,34 @@
1//! Elastic — 开发 — elastic.co, elasticsearch.org
2//!
3//! elastic
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Elastic — 开发 — elastic.co, elasticsearch.org
10pub struct Elastic;
11
12impl Platform for Elastic {
13 fn id(&self) -> &'static str {
14 "elastic"
15 }
16
17 fn name(&self) -> &'static str {
18 "Elastic"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["elastic.co", "elasticsearch.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Elastic = Elastic;
Added lib/social/src/parse/electron.rs lib/social/src/parse/electron.rs +34 −0 View lib/social/src/parse/electron.rs
@@ -0,0 +1,34 @@
1//! Electron — 开发 — electronjs.org, electronjs.com
2//!
3//! electron
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Electron — 开发 — electronjs.org, electronjs.com
10pub struct Electron;
11
12impl Platform for Electron {
13 fn id(&self) -> &'static str {
14 "electron"
15 }
16
17 fn name(&self) -> &'static str {
18 "Electron"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["electronjs.org", "electronjs.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Electron = Electron;
Added lib/social/src/parse/eleme.rs lib/social/src/parse/eleme.rs +34 −0 View lib/social/src/parse/eleme.rs
@@ -0,0 +1,34 @@
1//! 饿了么 — 电商 — ele.me, elemecdn.com
2//!
3//! eleme
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 饿了么 — 电商 — ele.me, elemecdn.com
10pub struct Eleme;
11
12impl Platform for Eleme {
13 fn id(&self) -> &'static str {
14 "eleme"
15 }
16
17 fn name(&self) -> &'static str {
18 "饿了么"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ele.me", "elemecdn.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Eleme = Eleme;
Added lib/social/src/parse/enshan.rs lib/social/src/parse/enshan.rs +34 −0 View lib/social/src/parse/enshan.rs
@@ -0,0 +1,34 @@
1//! 恩山无线论坛 — 论坛 — right.com.cn
2//!
3//! enshan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 恩山无线论坛 — 论坛 — right.com.cn
10pub struct Enshan;
11
12impl Platform for Enshan {
13 fn id(&self) -> &'static str {
14 "enshan"
15 }
16
17 fn name(&self) -> &'static str {
18 "恩山无线论坛"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["right.com.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Enshan = Enshan;
Added lib/social/src/parse/etsy.rs lib/social/src/parse/etsy.rs +34 −0 View lib/social/src/parse/etsy.rs
@@ -0,0 +1,34 @@
1//! Etsy — 电商 — etsy.com, etsy.me
2//!
3//! etsy
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Etsy — 电商 — etsy.com, etsy.me
10pub struct Etsy;
11
12impl Platform for Etsy {
13 fn id(&self) -> &'static str {
14 "etsy"
15 }
16
17 fn name(&self) -> &'static str {
18 "Etsy"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["etsy.com", "etsy.me"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Etsy = Etsy;
Added lib/social/src/parse/excalidraw.rs lib/social/src/parse/excalidraw.rs +34 −0 View lib/social/src/parse/excalidraw.rs
@@ -0,0 +1,34 @@
1//! Excalidraw — 开发 — excalidraw.com
2//!
3//! excalidraw
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Excalidraw — 开发 — excalidraw.com
10pub struct Excalidraw;
11
12impl Platform for Excalidraw {
13 fn id(&self) -> &'static str {
14 "excalidraw"
15 }
16
17 fn name(&self) -> &'static str {
18 "Excalidraw"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["excalidraw.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Excalidraw = Excalidraw;
Added lib/social/src/parse/expedia.rs lib/social/src/parse/expedia.rs +34 −0 View lib/social/src/parse/expedia.rs
@@ -0,0 +1,34 @@
1//! Expedia — 电商 — expedia.com
2//!
3//! expedia
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Expedia — 电商 — expedia.com
10pub struct Expedia;
11
12impl Platform for Expedia {
13 fn id(&self) -> &'static str {
14 "expedia"
15 }
16
17 fn name(&self) -> &'static str {
18 "Expedia"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["expedia.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Expedia = Expedia;
Added lib/social/src/parse/facebook.rs lib/social/src/parse/facebook.rs +33 −0 View lib/social/src/parse/facebook.rs
@@ -0,0 +1,33 @@
1//! Facebook — 社交 — facebook.com, fb.com, fb.watch, fb.me
2//!
3//! facebook
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Facebook — 社交 — facebook.com, fb.com, fb.watch, fb.me
9pub struct Facebook;
10
11impl Platform for Facebook {
12 fn id(&self) -> &'static str {
13 "facebook"
14 }
15
16 fn name(&self) -> &'static str {
17 "Facebook"
18 }
19
20 fn category(&self) -> Category {
21 Category::Social
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["facebook.com", "fb.com", "fb.watch", "fb.me"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://www.facebook.com/plugins/post.php?href={url_enc}&show_text=true&width=552"))
30 }
31}
32
33pub static PLATFORM: Facebook = Facebook;
Added lib/social/src/parse/feishu.rs lib/social/src/parse/feishu.rs +34 −0 View lib/social/src/parse/feishu.rs
@@ -0,0 +1,34 @@
1//! 飞书 — 社交 — feishu.cn, feishu.net, larksuite.com
2//!
3//! feishu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 飞书 — 社交 — feishu.cn, feishu.net, larksuite.com
10pub struct Feishu;
11
12impl Platform for Feishu {
13 fn id(&self) -> &'static str {
14 "feishu"
15 }
16
17 fn name(&self) -> &'static str {
18 "飞书"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["feishu.cn", "feishu.net", "larksuite.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Feishu = Feishu;
Added lib/social/src/parse/figma.rs lib/social/src/parse/figma.rs +38 −0 View lib/social/src/parse/figma.rs
@@ -0,0 +1,38 @@
1//! Figma — 开发 — figma.com
2//!
3//! figma
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Figma — 开发 — figma.com
9pub struct Figma;
10
11impl Platform for Figma {
12 fn id(&self) -> &'static str {
13 "figma"
14 }
15
16 fn name(&self) -> &'static str {
17 "Figma"
18 }
19
20 fn category(&self) -> Category {
21 Category::Dev
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["figma.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://www.figma.com/embed?embed_host=gitdata&url={url_enc}"))
30 }
31 /// oEmbed 接口,聊天侧联网补全标题 / 简介 / 封面(iframe 仅在平台自有域名下采用)。
32 fn oembed(&self) -> Option<&'static str> {
33 Some("https://www.figma.com/api/oembed?url={url_enc}")
34 }
35
36}
37
38pub static PLATFORM: Figma = Figma;
Added lib/social/src/parse/fliggy.rs lib/social/src/parse/fliggy.rs +34 −0 View lib/social/src/parse/fliggy.rs
@@ -0,0 +1,34 @@
1//! 飞猪 — 电商 — fliggy.com
2//!
3//! fliggy
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 飞猪 — 电商 — fliggy.com
10pub struct Fliggy;
11
12impl Platform for Fliggy {
13 fn id(&self) -> &'static str {
14 "fliggy"
15 }
16
17 fn name(&self) -> &'static str {
18 "飞猪"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["fliggy.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Fliggy = Fliggy;
Added lib/social/src/parse/flipkart.rs lib/social/src/parse/flipkart.rs +34 −0 View lib/social/src/parse/flipkart.rs
@@ -0,0 +1,34 @@
1//! Flipkart — 电商 — flipkart.com
2//!
3//! flipkart
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Flipkart — 电商 — flipkart.com
10pub struct Flipkart;
11
12impl Platform for Flipkart {
13 fn id(&self) -> &'static str {
14 "flipkart"
15 }
16
17 fn name(&self) -> &'static str {
18 "Flipkart"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["flipkart.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Flipkart = Flipkart;
Added lib/social/src/parse/flutter.rs lib/social/src/parse/flutter.rs +34 −0 View lib/social/src/parse/flutter.rs
@@ -0,0 +1,34 @@
1//! Flutter — 开发 — flutter.dev, dart.dev
2//!
3//! flutter
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Flutter — 开发 — flutter.dev, dart.dev
10pub struct Flutter;
11
12impl Platform for Flutter {
13 fn id(&self) -> &'static str {
14 "flutter"
15 }
16
17 fn name(&self) -> &'static str {
18 "Flutter"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["flutter.dev", "dart.dev"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Flutter = Flutter;
Added lib/social/src/parse/forbes.rs lib/social/src/parse/forbes.rs +34 −0 View lib/social/src/parse/forbes.rs
@@ -0,0 +1,34 @@
1//! Forbes — 新闻 — forbes.com
2//!
3//! forbes
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Forbes — 新闻 — forbes.com
10pub struct Forbes;
11
12impl Platform for Forbes {
13 fn id(&self) -> &'static str {
14 "forbes"
15 }
16
17 fn name(&self) -> &'static str {
18 "Forbes"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["forbes.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Forbes = Forbes;
Added lib/social/src/parse/funimation.rs lib/social/src/parse/funimation.rs +34 −0 View lib/social/src/parse/funimation.rs
@@ -0,0 +1,34 @@
1//! Funimation — 视频 — funimation.com
2//!
3//! funimation
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Funimation — 视频 — funimation.com
10pub struct Funimation;
11
12impl Platform for Funimation {
13 fn id(&self) -> &'static str {
14 "funimation"
15 }
16
17 fn name(&self) -> &'static str {
18 "Funimation"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["funimation.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Funimation = Funimation;
Added lib/social/src/parse/gab.rs lib/social/src/parse/gab.rs +34 −0 View lib/social/src/parse/gab.rs
@@ -0,0 +1,34 @@
1//! Gab — 社交 — gab.com
2//!
3//! gab
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Gab — 社交 — gab.com
10pub struct Gab;
11
12impl Platform for Gab {
13 fn id(&self) -> &'static str {
14 "gab"
15 }
16
17 fn name(&self) -> &'static str {
18 "Gab"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["gab.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Gab = Gab;
Added lib/social/src/parse/ganji.rs lib/social/src/parse/ganji.rs +34 −0 View lib/social/src/parse/ganji.rs
@@ -0,0 +1,34 @@
1//! 赶集网 — 电商 — ganji.com
2//!
3//! ganji
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 赶集网 — 电商 — ganji.com
10pub struct Ganji;
11
12impl Platform for Ganji {
13 fn id(&self) -> &'static str {
14 "ganji"
15 }
16
17 fn name(&self) -> &'static str {
18 "赶集网"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ganji.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ganji = Ganji;
Added lib/social/src/parse/gfan.rs lib/social/src/parse/gfan.rs +34 −0 View lib/social/src/parse/gfan.rs
@@ -0,0 +1,34 @@
1//! 机锋论坛 — 论坛 — gfan.com
2//!
3//! gfan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 机锋论坛 — 论坛 — gfan.com
10pub struct Gfan;
11
12impl Platform for Gfan {
13 fn id(&self) -> &'static str {
14 "gfan"
15 }
16
17 fn name(&self) -> &'static str {
18 "机锋论坛"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["gfan.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Gfan = Gfan;
Added lib/social/src/parse/gitbook.rs lib/social/src/parse/gitbook.rs +34 −0 View lib/social/src/parse/gitbook.rs
@@ -0,0 +1,34 @@
1//! GitBook — 知识 — gitbook.io, gitbook.com
2//!
3//! gitbook
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// GitBook — 知识 — gitbook.io, gitbook.com
10pub struct Gitbook;
11
12impl Platform for Gitbook {
13 fn id(&self) -> &'static str {
14 "gitbook"
15 }
16
17 fn name(&self) -> &'static str {
18 "GitBook"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["gitbook.io", "gitbook.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Gitbook = Gitbook;
Added lib/social/src/parse/gitee.rs lib/social/src/parse/gitee.rs +34 −0 View lib/social/src/parse/gitee.rs
@@ -0,0 +1,34 @@
1//! Gitee — 开发 — gitee.com, gitee.io
2//!
3//! gitee
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Gitee — 开发 — gitee.com, gitee.io
10pub struct Gitee;
11
12impl Platform for Gitee {
13 fn id(&self) -> &'static str {
14 "gitee"
15 }
16
17 fn name(&self) -> &'static str {
18 "Gitee"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["gitee.com", "gitee.io"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Gitee = Gitee;
Added lib/social/src/parse/github.rs lib/social/src/parse/github.rs +34 −0 View lib/social/src/parse/github.rs
@@ -0,0 +1,34 @@
1//! GitHub — 开发 — github.com, github.io, githubusercontent.com, github.blog
2//!
3//! github
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// GitHub — 开发 — github.com, github.io, githubusercontent.com, github.blog
10pub struct Github;
11
12impl Platform for Github {
13 fn id(&self) -> &'static str {
14 "github"
15 }
16
17 fn name(&self) -> &'static str {
18 "GitHub"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["github.com", "github.io", "githubusercontent.com", "github.blog"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Github = Github;
Added lib/social/src/parse/gitlab.rs lib/social/src/parse/gitlab.rs +34 −0 View lib/social/src/parse/gitlab.rs
@@ -0,0 +1,34 @@
1//! GitLab — 开发 — gitlab.com, gitlab.io, gitlab.cn
2//!
3//! gitlab
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// GitLab — 开发 — gitlab.com, gitlab.io, gitlab.cn
10pub struct Gitlab;
11
12impl Platform for Gitlab {
13 fn id(&self) -> &'static str {
14 "gitlab"
15 }
16
17 fn name(&self) -> &'static str {
18 "GitLab"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["gitlab.com", "gitlab.io", "gitlab.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Gitlab = Gitlab;
Added lib/social/src/parse/glitch.rs lib/social/src/parse/glitch.rs +34 −0 View lib/social/src/parse/glitch.rs
@@ -0,0 +1,34 @@
1//! Glitch — 开发 — glitch.me, glitch.com
2//!
3//! glitch
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Glitch — 开发 — glitch.me, glitch.com
10pub struct Glitch;
11
12impl Platform for Glitch {
13 fn id(&self) -> &'static str {
14 "glitch"
15 }
16
17 fn name(&self) -> &'static str {
18 "Glitch"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["glitch.me", "glitch.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Glitch = Glitch;
Added lib/social/src/parse/golang.rs lib/social/src/parse/golang.rs +34 −0 View lib/social/src/parse/golang.rs
@@ -0,0 +1,34 @@
1//! Go — 开发 — go.dev, golang.org
2//!
3//! golang
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Go — 开发 — go.dev, golang.org
10pub struct Golang;
11
12impl Platform for Golang {
13 fn id(&self) -> &'static str {
14 "golang"
15 }
16
17 fn name(&self) -> &'static str {
18 "Go"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["go.dev", "golang.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Golang = Golang;
Added lib/social/src/parse/gome.rs lib/social/src/parse/gome.rs +34 −0 View lib/social/src/parse/gome.rs
@@ -0,0 +1,34 @@
1//! 国美 — 电商 — gome.com.cn
2//!
3//! gome
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 国美 — 电商 — gome.com.cn
10pub struct Gome;
11
12impl Platform for Gome {
13 fn id(&self) -> &'static str {
14 "gome"
15 }
16
17 fn name(&self) -> &'static str {
18 "国美"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["gome.com.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Gome = Gome;
Added lib/social/src/parse/googledrive.rs lib/social/src/parse/googledrive.rs +34 −0 View lib/social/src/parse/googledrive.rs
@@ -0,0 +1,34 @@
1//! Google Drive — 开发 — drive.google.com, docs.google.com, sheets.google.com, slides.google.com
2//!
3//! googledrive
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Google Drive — 开发 — drive.google.com, docs.google.com, sheets.google.com, slides.google.com
10pub struct Googledrive;
11
12impl Platform for Googledrive {
13 fn id(&self) -> &'static str {
14 "googledrive"
15 }
16
17 fn name(&self) -> &'static str {
18 "Google Drive"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["drive.google.com", "docs.google.com", "sheets.google.com", "slides.google.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Googledrive = Googledrive;
Added lib/social/src/parse/googlemaps.rs lib/social/src/parse/googlemaps.rs +33 −0 View lib/social/src/parse/googlemaps.rs
@@ -0,0 +1,33 @@
1//! Google Maps — 开发 — maps.google.com
2//!
3//! googlemaps
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Google Maps — 开发 — maps.google.com
9pub struct Googlemaps;
10
11impl Platform for Googlemaps {
12 fn id(&self) -> &'static str {
13 "googlemaps"
14 }
15
16 fn name(&self) -> &'static str {
17 "Google Maps"
18 }
19
20 fn category(&self) -> Category {
21 Category::Dev
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["maps.google.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://maps.google.com/maps?q={url_enc}&output=embed"))
30 }
31}
32
33pub static PLATFORM: Googlemaps = Googlemaps;
Added lib/social/src/parse/grafana.rs lib/social/src/parse/grafana.rs +34 −0 View lib/social/src/parse/grafana.rs
@@ -0,0 +1,34 @@
1//! Grafana — 开发 — grafana.com
2//!
3//! grafana
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Grafana — 开发 — grafana.com
10pub struct Grafana;
11
12impl Platform for Grafana {
13 fn id(&self) -> &'static str {
14 "grafana"
15 }
16
17 fn name(&self) -> &'static str {
18 "Grafana"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["grafana.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Grafana = Grafana;
Added lib/social/src/parse/grubhub.rs lib/social/src/parse/grubhub.rs +34 −0 View lib/social/src/parse/grubhub.rs
@@ -0,0 +1,34 @@
1//! Grubhub — 电商 — grubhub.com
2//!
3//! grubhub
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Grubhub — 电商 — grubhub.com
10pub struct Grubhub;
11
12impl Platform for Grubhub {
13 fn id(&self) -> &'static str {
14 "grubhub"
15 }
16
17 fn name(&self) -> &'static str {
18 "Grubhub"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["grubhub.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Grubhub = Grubhub;
Added lib/social/src/parse/guancha.rs lib/social/src/parse/guancha.rs +34 −0 View lib/social/src/parse/guancha.rs
@@ -0,0 +1,34 @@
1//! 观察者网 — 新闻 — guancha.cn, guancha.com
2//!
3//! guancha
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 观察者网 — 新闻 — guancha.cn, guancha.com
10pub struct Guancha;
11
12impl Platform for Guancha {
13 fn id(&self) -> &'static str {
14 "guancha"
15 }
16
17 fn name(&self) -> &'static str {
18 "观察者网"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["guancha.cn", "guancha.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Guancha = Guancha;
Added lib/social/src/parse/guokr.rs lib/social/src/parse/guokr.rs +34 −0 View lib/social/src/parse/guokr.rs
@@ -0,0 +1,34 @@
1//! 果壳 — 知识 — guokr.com
2//!
3//! guokr
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 果壳 — 知识 — guokr.com
10pub struct Guokr;
11
12impl Platform for Guokr {
13 fn id(&self) -> &'static str {
14 "guokr"
15 }
16
17 fn name(&self) -> &'static str {
18 "果壳"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["guokr.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Guokr = Guokr;
Added lib/social/src/parse/hackernews.rs lib/social/src/parse/hackernews.rs +34 −0 View lib/social/src/parse/hackernews.rs
@@ -0,0 +1,34 @@
1//! Hacker News — 新闻 — news.ycombinator.com
2//!
3//! hackernews
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Hacker News — 新闻 — news.ycombinator.com
10pub struct Hackernews;
11
12impl Platform for Hackernews {
13 fn id(&self) -> &'static str {
14 "hackernews"
15 }
16
17 fn name(&self) -> &'static str {
18 "Hacker News"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["news.ycombinator.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Hackernews = Hackernews;
Added lib/social/src/parse/hanju.rs lib/social/src/parse/hanju.rs +34 −0 View lib/social/src/parse/hanju.rs
@@ -0,0 +1,34 @@
1//! 韩剧TV — 视频 — hanjutv2020.com, hanju.tv
2//!
3//! hanju
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 韩剧TV — 视频 — hanjutv2020.com, hanju.tv
10pub struct Hanju;
11
12impl Platform for Hanju {
13 fn id(&self) -> &'static str {
14 "hanju"
15 }
16
17 fn name(&self) -> &'static str {
18 "韩剧TV"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["hanjutv2020.com", "hanju.tv"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Hanju = Hanju;
Added lib/social/src/parse/haokan.rs lib/social/src/parse/haokan.rs +34 −0 View lib/social/src/parse/haokan.rs
@@ -0,0 +1,34 @@
1//! 好看视频 — 视频 — haokan.baidu.com
2//!
3//! haokan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 好看视频 — 视频 — haokan.baidu.com
10pub struct Haokan;
11
12impl Platform for Haokan {
13 fn id(&self) -> &'static str {
14 "haokan"
15 }
16
17 fn name(&self) -> &'static str {
18 "好看视频"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["haokan.baidu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Haokan = Haokan;
Added lib/social/src/parse/hashnode.rs lib/social/src/parse/hashnode.rs +34 −0 View lib/social/src/parse/hashnode.rs
@@ -0,0 +1,34 @@
1//! Hashnode — 开发 — hashnode.dev, hashnode.com
2//!
3//! hashnode
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Hashnode — 开发 — hashnode.dev, hashnode.com
10pub struct Hashnode;
11
12impl Platform for Hashnode {
13 fn id(&self) -> &'static str {
14 "hashnode"
15 }
16
17 fn name(&self) -> &'static str {
18 "Hashnode"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["hashnode.dev", "hashnode.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Hashnode = Hashnode;
Added lib/social/src/parse/homedepot.rs lib/social/src/parse/homedepot.rs +34 −0 View lib/social/src/parse/homedepot.rs
@@ -0,0 +1,34 @@
1//! Home Depot — 电商 — homedepot.com
2//!
3//! homedepot
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Home Depot — 电商 — homedepot.com
10pub struct Homedepot;
11
12impl Platform for Homedepot {
13 fn id(&self) -> &'static str {
14 "homedepot"
15 }
16
17 fn name(&self) -> &'static str {
18 "Home Depot"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["homedepot.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Homedepot = Homedepot;
Added lib/social/src/parse/hotstar.rs lib/social/src/parse/hotstar.rs +34 −0 View lib/social/src/parse/hotstar.rs
@@ -0,0 +1,34 @@
1//! Hotstar — 视频 — hotstar.com
2//!
3//! hotstar
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Hotstar — 视频 — hotstar.com
10pub struct Hotstar;
11
12impl Platform for Hotstar {
13 fn id(&self) -> &'static str {
14 "hotstar"
15 }
16
17 fn name(&self) -> &'static str {
18 "Hotstar"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["hotstar.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Hotstar = Hotstar;
Added lib/social/src/parse/huaban.rs lib/social/src/parse/huaban.rs +34 −0 View lib/social/src/parse/huaban.rs
@@ -0,0 +1,34 @@
1//! 花瓣网 — 知识 — huaban.com
2//!
3//! huaban
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 花瓣网 — 知识 — huaban.com
10pub struct Huaban;
11
12impl Platform for Huaban {
13 fn id(&self) -> &'static str {
14 "huaban"
15 }
16
17 fn name(&self) -> &'static str {
18 "花瓣网"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["huaban.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Huaban = Huaban;
Added lib/social/src/parse/huajiao.rs lib/social/src/parse/huajiao.rs +34 −0 View lib/social/src/parse/huajiao.rs
@@ -0,0 +1,34 @@
1//! 花椒直播 — 直播 — huajiao.com
2//!
3//! huajiao
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 花椒直播 — 直播 — huajiao.com
10pub struct Huajiao;
11
12impl Platform for Huajiao {
13 fn id(&self) -> &'static str {
14 "huajiao"
15 }
16
17 fn name(&self) -> &'static str {
18 "花椒直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["huajiao.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Huajiao = Huajiao;
Added lib/social/src/parse/huanqiu.rs lib/social/src/parse/huanqiu.rs +34 −0 View lib/social/src/parse/huanqiu.rs
@@ -0,0 +1,34 @@
1//! 环球网 — 新闻 — huanqiu.com
2//!
3//! huanqiu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 环球网 — 新闻 — huanqiu.com
10pub struct Huanqiu;
11
12impl Platform for Huanqiu {
13 fn id(&self) -> &'static str {
14 "huanqiu"
15 }
16
17 fn name(&self) -> &'static str {
18 "环球网"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["huanqiu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Huanqiu = Huanqiu;
Added lib/social/src/parse/huggingface.rs lib/social/src/parse/huggingface.rs +34 −0 View lib/social/src/parse/huggingface.rs
@@ -0,0 +1,34 @@
1//! Hugging Face — 开发 — huggingface.co
2//!
3//! huggingface
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Hugging Face — 开发 — huggingface.co
10pub struct Huggingface;
11
12impl Platform for Huggingface {
13 fn id(&self) -> &'static str {
14 "huggingface"
15 }
16
17 fn name(&self) -> &'static str {
18 "Hugging Face"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["huggingface.co"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Huggingface = Huggingface;
Added lib/social/src/parse/hulu.rs lib/social/src/parse/hulu.rs +34 −0 View lib/social/src/parse/hulu.rs
@@ -0,0 +1,34 @@
1//! Hulu — 视频 — hulu.com
2//!
3//! hulu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Hulu — 视频 — hulu.com
10pub struct Hulu;
11
12impl Platform for Hulu {
13 fn id(&self) -> &'static str {
14 "hulu"
15 }
16
17 fn name(&self) -> &'static str {
18 "Hulu"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["hulu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Hulu = Hulu;
Added lib/social/src/parse/huoshan.rs lib/social/src/parse/huoshan.rs +34 −0 View lib/social/src/parse/huoshan.rs
@@ -0,0 +1,34 @@
1//! 火山小视频 — 视频 — huoshan.com
2//!
3//! huoshan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 火山小视频 — 视频 — huoshan.com
10pub struct Huoshan;
11
12impl Platform for Huoshan {
13 fn id(&self) -> &'static str {
14 "huoshan"
15 }
16
17 fn name(&self) -> &'static str {
18 "火山小视频"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["huoshan.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Huoshan = Huoshan;
Added lib/social/src/parse/hupu.rs lib/social/src/parse/hupu.rs +34 −0 View lib/social/src/parse/hupu.rs
@@ -0,0 +1,34 @@
1//! 虎扑 — 论坛 — hupu.com, hoopchina.com
2//!
3//! hupu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 虎扑 — 论坛 — hupu.com, hoopchina.com
10pub struct Hupu;
11
12impl Platform for Hupu {
13 fn id(&self) -> &'static str {
14 "hupu"
15 }
16
17 fn name(&self) -> &'static str {
18 "虎扑"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["hupu.com", "hoopchina.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Hupu = Hupu;
Added lib/social/src/parse/huxiu.rs lib/social/src/parse/huxiu.rs +34 −0 View lib/social/src/parse/huxiu.rs
@@ -0,0 +1,34 @@
1//! 虎嗅 — 新闻 — huxiu.com
2//!
3//! huxiu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 虎嗅 — 新闻 — huxiu.com
10pub struct Huxiu;
11
12impl Platform for Huxiu {
13 fn id(&self) -> &'static str {
14 "huxiu"
15 }
16
17 fn name(&self) -> &'static str {
18 "虎嗅"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["huxiu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Huxiu = Huxiu;
Added lib/social/src/parse/huya.rs lib/social/src/parse/huya.rs +34 −0 View lib/social/src/parse/huya.rs
@@ -0,0 +1,34 @@
1//! 虎牙直播 — 直播 — huya.com
2//!
3//! huya
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 虎牙直播 — 直播 — huya.com
10pub struct Huya;
11
12impl Platform for Huya {
13 fn id(&self) -> &'static str {
14 "huya"
15 }
16
17 fn name(&self) -> &'static str {
18 "虎牙直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["huya.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Huya = Huya;
Added lib/social/src/parse/ieee.rs lib/social/src/parse/ieee.rs +34 −0 View lib/social/src/parse/ieee.rs
@@ -0,0 +1,34 @@
1//! IEEE Xplore — 知识 — ieee.org, ieeexplore.ieee.org
2//!
3//! ieee
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// IEEE Xplore — 知识 — ieee.org, ieeexplore.ieee.org
10pub struct Ieee;
11
12impl Platform for Ieee {
13 fn id(&self) -> &'static str {
14 "ieee"
15 }
16
17 fn name(&self) -> &'static str {
18 "IEEE Xplore"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ieee.org", "ieeexplore.ieee.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ieee = Ieee;
Added lib/social/src/parse/ifanr.rs lib/social/src/parse/ifanr.rs +34 −0 View lib/social/src/parse/ifanr.rs
@@ -0,0 +1,34 @@
1//! 爱范儿 — 新闻 — ifanr.com
2//!
3//! ifanr
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 爱范儿 — 新闻 — ifanr.com
10pub struct Ifanr;
11
12impl Platform for Ifanr {
13 fn id(&self) -> &'static str {
14 "ifanr"
15 }
16
17 fn name(&self) -> &'static str {
18 "爱范儿"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ifanr.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ifanr = Ifanr;
Added lib/social/src/parse/ifeng.rs lib/social/src/parse/ifeng.rs +34 −0 View lib/social/src/parse/ifeng.rs
@@ -0,0 +1,34 @@
1//! 凤凰网 — 新闻 — ifeng.com
2//!
3//! ifeng
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 凤凰网 — 新闻 — ifeng.com
10pub struct Ifeng;
11
12impl Platform for Ifeng {
13 fn id(&self) -> &'static str {
14 "ifeng"
15 }
16
17 fn name(&self) -> &'static str {
18 "凤凰网"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ifeng.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ifeng = Ifeng;
Added lib/social/src/parse/ifttt.rs lib/social/src/parse/ifttt.rs +34 −0 View lib/social/src/parse/ifttt.rs
@@ -0,0 +1,34 @@
1//! IFTTT — 开发 — ifttt.com
2//!
3//! ifttt
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// IFTTT — 开发 — ifttt.com
10pub struct Ifttt;
11
12impl Platform for Ifttt {
13 fn id(&self) -> &'static str {
14 "ifttt"
15 }
16
17 fn name(&self) -> &'static str {
18 "IFTTT"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ifttt.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ifttt = Ifttt;
Added lib/social/src/parse/iheartradio.rs lib/social/src/parse/iheartradio.rs +34 −0 View lib/social/src/parse/iheartradio.rs
@@ -0,0 +1,34 @@
1//! iHeartRadio — 音乐 — iheart.com, iheartradio.com
2//!
3//! iheartradio
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// iHeartRadio — 音乐 — iheart.com, iheartradio.com
10pub struct Iheartradio;
11
12impl Platform for Iheartradio {
13 fn id(&self) -> &'static str {
14 "iheartradio"
15 }
16
17 fn name(&self) -> &'static str {
18 "iHeartRadio"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["iheart.com", "iheartradio.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Iheartradio = Iheartradio;
Added lib/social/src/parse/ikea.rs lib/social/src/parse/ikea.rs +34 −0 View lib/social/src/parse/ikea.rs
@@ -0,0 +1,34 @@
1//! 宜家 — 电商 — ikea.com, ikea.cn
2//!
3//! ikea
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 宜家 — 电商 — ikea.com, ikea.cn
10pub struct Ikea;
11
12impl Platform for Ikea {
13 fn id(&self) -> &'static str {
14 "ikea"
15 }
16
17 fn name(&self) -> &'static str {
18 "宜家"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["ikea.com", "ikea.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Ikea = Ikea;
Added lib/social/src/parse/infoq.rs lib/social/src/parse/infoq.rs +34 −0 View lib/social/src/parse/infoq.rs
@@ -0,0 +1,34 @@
1//! InfoQ — 开发 — infoq.com, infoq.cn
2//!
3//! infoq
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// InfoQ — 开发 — infoq.com, infoq.cn
10pub struct Infoq;
11
12impl Platform for Infoq {
13 fn id(&self) -> &'static str {
14 "infoq"
15 }
16
17 fn name(&self) -> &'static str {
18 "InfoQ"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["infoq.com", "infoq.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Infoq = Infoq;
Added lib/social/src/parse/inke.rs lib/social/src/parse/inke.rs +34 −0 View lib/social/src/parse/inke.rs
@@ -0,0 +1,34 @@
1//! 映客直播 — 直播 — inke.cn
2//!
3//! inke
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 映客直播 — 直播 — inke.cn
10pub struct Inke;
11
12impl Platform for Inke {
13 fn id(&self) -> &'static str {
14 "inke"
15 }
16
17 fn name(&self) -> &'static str {
18 "映客直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["inke.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Inke = Inke;
Added lib/social/src/parse/instacart.rs lib/social/src/parse/instacart.rs +34 −0 View lib/social/src/parse/instacart.rs
@@ -0,0 +1,34 @@
1//! Instacart — 电商 — instacart.com
2//!
3//! instacart
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Instacart — 电商 — instacart.com
10pub struct Instacart;
11
12impl Platform for Instacart {
13 fn id(&self) -> &'static str {
14 "instacart"
15 }
16
17 fn name(&self) -> &'static str {
18 "Instacart"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["instacart.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Instacart = Instacart;
Added lib/social/src/parse/instagram.rs lib/social/src/parse/instagram.rs +33 −0 View lib/social/src/parse/instagram.rs
@@ -0,0 +1,33 @@
1//! Instagram — 社交 — instagram.com, instagr.am
2//!
3//! instagram
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Instagram — 社交 — instagram.com, instagr.am
9pub struct Instagram;
10
11impl Platform for Instagram {
12 fn id(&self) -> &'static str {
13 "instagram"
14 }
15
16 fn name(&self) -> &'static str {
17 "Instagram"
18 }
19
20 fn category(&self) -> Category {
21 Category::Social
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["instagram.com", "instagr.am"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::tall("^/(?:p|reel|tv)/([A-Za-z0-9_-]+)", "https://www.instagram.com/p/{id}/embed"))
30 }
31}
32
33pub static PLATFORM: Instagram = Instagram;
Added lib/social/src/parse/iqiyi.rs lib/social/src/parse/iqiyi.rs +34 −0 View lib/social/src/parse/iqiyi.rs
@@ -0,0 +1,34 @@
1//! 爱奇艺 — 视频 — iqiyi.com, iq.com, qy.net
2//!
3//! iqiyi
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 爱奇艺 — 视频 — iqiyi.com, iq.com, qy.net
10pub struct Iqiyi;
11
12impl Platform for Iqiyi {
13 fn id(&self) -> &'static str {
14 "iqiyi"
15 }
16
17 fn name(&self) -> &'static str {
18 "爱奇艺"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["iqiyi.com", "iq.com", "qy.net"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Iqiyi = Iqiyi;
Added lib/social/src/parse/iyiou.rs lib/social/src/parse/iyiou.rs +34 −0 View lib/social/src/parse/iyiou.rs
@@ -0,0 +1,34 @@
1//! 亿欧 — 新闻 — iyiou.com
2//!
3//! iyiou
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 亿欧 — 新闻 — iyiou.com
10pub struct Iyiou;
11
12impl Platform for Iyiou {
13 fn id(&self) -> &'static str {
14 "iyiou"
15 }
16
17 fn name(&self) -> &'static str {
18 "亿欧"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["iyiou.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Iyiou = Iyiou;
Added lib/social/src/parse/jd.rs lib/social/src/parse/jd.rs +34 −0 View lib/social/src/parse/jd.rs
@@ -0,0 +1,34 @@
1//! 京东 — 电商 — jd.com, jd.hk, 3.cn
2//!
3//! jd
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 京东 — 电商 — jd.com, jd.hk, 3.cn
10pub struct Jd;
11
12impl Platform for Jd {
13 fn id(&self) -> &'static str {
14 "jd"
15 }
16
17 fn name(&self) -> &'static str {
18 "京东"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["jd.com", "jd.hk", "3.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Jd = Jd;
Added lib/social/src/parse/jianshu.rs lib/social/src/parse/jianshu.rs +34 −0 View lib/social/src/parse/jianshu.rs
@@ -0,0 +1,34 @@
1//! 简书 — 社交 — jianshu.com
2//!
3//! jianshu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 简书 — 社交 — jianshu.com
10pub struct Jianshu;
11
12impl Platform for Jianshu {
13 fn id(&self) -> &'static str {
14 "jianshu"
15 }
16
17 fn name(&self) -> &'static str {
18 "简书"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["jianshu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Jianshu = Jianshu;
Added lib/social/src/parse/jiemian.rs lib/social/src/parse/jiemian.rs +34 −0 View lib/social/src/parse/jiemian.rs
@@ -0,0 +1,34 @@
1//! 界面新闻 — 新闻 — jiemian.com
2//!
3//! jiemian
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 界面新闻 — 新闻 — jiemian.com
10pub struct Jiemian;
11
12impl Platform for Jiemian {
13 fn id(&self) -> &'static str {
14 "jiemian"
15 }
16
17 fn name(&self) -> &'static str {
18 "界面新闻"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["jiemian.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Jiemian = Jiemian;
Added lib/social/src/parse/jike.rs lib/social/src/parse/jike.rs +34 −0 View lib/social/src/parse/jike.rs
@@ -0,0 +1,34 @@
1//! 即刻 — 社交 — okjike.com
2//!
3//! jike
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 即刻 — 社交 — okjike.com
10pub struct Jike;
11
12impl Platform for Jike {
13 fn id(&self) -> &'static str {
14 "jike"
15 }
16
17 fn name(&self) -> &'static str {
18 "即刻"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["okjike.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Jike = Jike;
Added lib/social/src/parse/joox.rs lib/social/src/parse/joox.rs +34 −0 View lib/social/src/parse/joox.rs
@@ -0,0 +1,34 @@
1//! JOOX — 音乐 — joox.com
2//!
3//! joox
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// JOOX — 音乐 — joox.com
10pub struct Joox;
11
12impl Platform for Joox {
13 fn id(&self) -> &'static str {
14 "joox"
15 }
16
17 fn name(&self) -> &'static str {
18 "JOOX"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["joox.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Joox = Joox;
Added lib/social/src/parse/jsfiddle.rs lib/social/src/parse/jsfiddle.rs +33 −0 View lib/social/src/parse/jsfiddle.rs
@@ -0,0 +1,33 @@
1//! JSFiddle — 开发 — jsfiddle.net
2//!
3//! jsfiddle
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// JSFiddle — 开发 — jsfiddle.net
9pub struct Jsfiddle;
10
11impl Platform for Jsfiddle {
12 fn id(&self) -> &'static str {
13 "jsfiddle"
14 }
15
16 fn name(&self) -> &'static str {
17 "JSFiddle"
18 }
19
20 fn category(&self) -> Category {
21 Category::Dev
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["jsfiddle.net"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide("^/([A-Za-z0-9]+)", "https://jsfiddle.net/{id}/embedded/js,html,css,result/dark/"))
30 }
31}
32
33pub static PLATFORM: Jsfiddle = Jsfiddle;
Added lib/social/src/parse/juejin.rs lib/social/src/parse/juejin.rs +34 −0 View lib/social/src/parse/juejin.rs
@@ -0,0 +1,34 @@
1//! 掘金 — 开发 — juejin.cn, juejin.im
2//!
3//! juejin
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 掘金 — 开发 — juejin.cn, juejin.im
10pub struct Juejin;
11
12impl Platform for Juejin {
13 fn id(&self) -> &'static str {
14 "juejin"
15 }
16
17 fn name(&self) -> &'static str {
18 "掘金"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["juejin.cn", "juejin.im"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Juejin = Juejin;
Added lib/social/src/parse/jumei.rs lib/social/src/parse/jumei.rs +34 −0 View lib/social/src/parse/jumei.rs
@@ -0,0 +1,34 @@
1//! 聚美优品 — 电商 — jumei.com
2//!
3//! jumei
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 聚美优品 — 电商 — jumei.com
10pub struct Jumei;
11
12impl Platform for Jumei {
13 fn id(&self) -> &'static str {
14 "jumei"
15 }
16
17 fn name(&self) -> &'static str {
18 "聚美优品"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["jumei.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Jumei = Jumei;
Added lib/social/src/parse/kafan.rs lib/social/src/parse/kafan.rs +34 −0 View lib/social/src/parse/kafan.rs
@@ -0,0 +1,34 @@
1//! 卡饭论坛 — 论坛 — kafan.cn
2//!
3//! kafan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 卡饭论坛 — 论坛 — kafan.cn
10pub struct Kafan;
11
12impl Platform for Kafan {
13 fn id(&self) -> &'static str {
14 "kafan"
15 }
16
17 fn name(&self) -> &'static str {
18 "卡饭论坛"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kafan.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kafan = Kafan;
Added lib/social/src/parse/kaggle.rs lib/social/src/parse/kaggle.rs +34 −0 View lib/social/src/parse/kaggle.rs
@@ -0,0 +1,34 @@
1//! Kaggle — 开发 — kaggle.com
2//!
3//! kaggle
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Kaggle — 开发 — kaggle.com
10pub struct Kaggle;
11
12impl Platform for Kaggle {
13 fn id(&self) -> &'static str {
14 "kaggle"
15 }
16
17 fn name(&self) -> &'static str {
18 "Kaggle"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kaggle.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kaggle = Kaggle;
Added lib/social/src/parse/kaixin.rs lib/social/src/parse/kaixin.rs +34 −0 View lib/social/src/parse/kaixin.rs
@@ -0,0 +1,34 @@
1//! 开心网 — 社交 — kaixin001.com
2//!
3//! kaixin
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 开心网 — 社交 — kaixin001.com
10pub struct Kaixin;
11
12impl Platform for Kaixin {
13 fn id(&self) -> &'static str {
14 "kaixin"
15 }
16
17 fn name(&self) -> &'static str {
18 "开心网"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kaixin001.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kaixin = Kaixin;
Added lib/social/src/parse/kernel.rs lib/social/src/parse/kernel.rs +34 −0 View lib/social/src/parse/kernel.rs
@@ -0,0 +1,34 @@
1//! Linux Kernel — 开发 — kernel.org, linuxfoundation.org
2//!
3//! kernel
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Linux Kernel — 开发 — kernel.org, linuxfoundation.org
10pub struct Kernel;
11
12impl Platform for Kernel {
13 fn id(&self) -> &'static str {
14 "kernel"
15 }
16
17 fn name(&self) -> &'static str {
18 "Linux Kernel"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kernel.org", "linuxfoundation.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kernel = Kernel;
Added lib/social/src/parse/kfc.rs lib/social/src/parse/kfc.rs +34 −0 View lib/social/src/parse/kfc.rs
@@ -0,0 +1,34 @@
1//! 肯德基 — 电商 — kfc.com.cn, kfc.com
2//!
3//! kfc
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 肯德基 — 电商 — kfc.com.cn, kfc.com
10pub struct Kfc;
11
12impl Platform for Kfc {
13 fn id(&self) -> &'static str {
14 "kfc"
15 }
16
17 fn name(&self) -> &'static str {
18 "肯德基"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kfc.com.cn", "kfc.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kfc = Kfc;
Added lib/social/src/parse/kick.rs lib/social/src/parse/kick.rs +34 −0 View lib/social/src/parse/kick.rs
@@ -0,0 +1,34 @@
1//! Kick — 直播 — kick.com
2//!
3//! kick
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Kick — 直播 — kick.com
10pub struct Kick;
11
12impl Platform for Kick {
13 fn id(&self) -> &'static str {
14 "kick"
15 }
16
17 fn name(&self) -> &'static str {
18 "Kick"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kick.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kick = Kick;
Added lib/social/src/parse/kik.rs lib/social/src/parse/kik.rs +34 −0 View lib/social/src/parse/kik.rs
@@ -0,0 +1,34 @@
1//! Kik — 社交 — kik.me
2//!
3//! kik
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Kik — 社交 — kik.me
10pub struct Kik;
11
12impl Platform for Kik {
13 fn id(&self) -> &'static str {
14 "kik"
15 }
16
17 fn name(&self) -> &'static str {
18 "Kik"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kik.me"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kik = Kik;
Added lib/social/src/parse/kkbox.rs lib/social/src/parse/kkbox.rs +34 −0 View lib/social/src/parse/kkbox.rs
@@ -0,0 +1,34 @@
1//! KKBOX — 音乐 — kkbox.com, kkbox.fm
2//!
3//! kkbox
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// KKBOX — 音乐 — kkbox.com, kkbox.fm
10pub struct Kkbox;
11
12impl Platform for Kkbox {
13 fn id(&self) -> &'static str {
14 "kkbox"
15 }
16
17 fn name(&self) -> &'static str {
18 "KKBOX"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kkbox.com", "kkbox.fm"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kkbox = Kkbox;
Added lib/social/src/parse/kktv.rs lib/social/src/parse/kktv.rs +34 −0 View lib/social/src/parse/kktv.rs
@@ -0,0 +1,34 @@
1//! KKTV — 视频 — kktv.me
2//!
3//! kktv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// KKTV — 视频 — kktv.me
10pub struct Kktv;
11
12impl Platform for Kktv {
13 fn id(&self) -> &'static str {
14 "kktv"
15 }
16
17 fn name(&self) -> &'static str {
18 "KKTV"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kktv.me"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kktv = Kktv;
Added lib/social/src/parse/kotlin.rs lib/social/src/parse/kotlin.rs +34 −0 View lib/social/src/parse/kotlin.rs
@@ -0,0 +1,34 @@
1//! Kotlin — 开发 — kotlinlang.org
2//!
3//! kotlin
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Kotlin — 开发 — kotlinlang.org
10pub struct Kotlin;
11
12impl Platform for Kotlin {
13 fn id(&self) -> &'static str {
14 "kotlin"
15 }
16
17 fn name(&self) -> &'static str {
18 "Kotlin"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kotlinlang.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kotlin = Kotlin;
Added lib/social/src/parse/kuaishou.rs lib/social/src/parse/kuaishou.rs +34 −0 View lib/social/src/parse/kuaishou.rs
@@ -0,0 +1,34 @@
1//! 快手 — 社交 — kuaishou.com, gifshow.com, chenzhongtech.com
2//!
3//! kuaishou
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 快手 — 社交 — kuaishou.com, gifshow.com, chenzhongtech.com
10pub struct Kuaishou;
11
12impl Platform for Kuaishou {
13 fn id(&self) -> &'static str {
14 "kuaishou"
15 }
16
17 fn name(&self) -> &'static str {
18 "快手"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kuaishou.com", "gifshow.com", "chenzhongtech.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kuaishou = Kuaishou;
Added lib/social/src/parse/kuaishou_live.rs lib/social/src/parse/kuaishou_live.rs +34 −0 View lib/social/src/parse/kuaishou_live.rs
@@ -0,0 +1,34 @@
1//! 快手直播 — 直播 — live.kuaishou.com
2//!
3//! kuaishou-live
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 快手直播 — 直播 — live.kuaishou.com
10pub struct KuaishouLive;
11
12impl Platform for KuaishouLive {
13 fn id(&self) -> &'static str {
14 "kuaishou-live"
15 }
16
17 fn name(&self) -> &'static str {
18 "快手直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["live.kuaishou.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: KuaishouLive = KuaishouLive;
Added lib/social/src/parse/kugou.rs lib/social/src/parse/kugou.rs +34 −0 View lib/social/src/parse/kugou.rs
@@ -0,0 +1,34 @@
1//! 酷狗音乐 — 音乐 — kugou.com
2//!
3//! kugou
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 酷狗音乐 — 音乐 — kugou.com
10pub struct Kugou;
11
12impl Platform for Kugou {
13 fn id(&self) -> &'static str {
14 "kugou"
15 }
16
17 fn name(&self) -> &'static str {
18 "酷狗音乐"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kugou.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kugou = Kugou;
Added lib/social/src/parse/kuwo.rs lib/social/src/parse/kuwo.rs +34 −0 View lib/social/src/parse/kuwo.rs
@@ -0,0 +1,34 @@
1//! 酷我音乐 — 音乐 — kuwo.cn
2//!
3//! kuwo
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 酷我音乐 — 音乐 — kuwo.cn
10pub struct Kuwo;
11
12impl Platform for Kuwo {
13 fn id(&self) -> &'static str {
14 "kuwo"
15 }
16
17 fn name(&self) -> &'static str {
18 "酷我音乐"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kuwo.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Kuwo = Kuwo;
Added lib/social/src/parse/langlive.rs lib/social/src/parse/langlive.rs +34 −0 View lib/social/src/parse/langlive.rs
@@ -0,0 +1,34 @@
1//! 浪LIVE — 直播 — lang.live
2//!
3//! langlive
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 浪LIVE — 直播 — lang.live
10pub struct Langlive;
11
12impl Platform for Langlive {
13 fn id(&self) -> &'static str {
14 "langlive"
15 }
16
17 fn name(&self) -> &'static str {
18 "浪LIVE"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["lang.live"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Langlive = Langlive;
Added lib/social/src/parse/lazada.rs lib/social/src/parse/lazada.rs +34 −0 View lib/social/src/parse/lazada.rs
@@ -0,0 +1,34 @@
1//! Lazada — 电商 — lazada.com, lazada.co.th, lazada.sg, lazada.com.my, lazada.ph, lazada.co.id, lazada.vn
2//!
3//! lazada
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Lazada — 电商 — lazada.com, lazada.co.th, lazada.sg, lazada.com.my, lazada.ph, lazada.co.id, lazada.vn
10pub struct Lazada;
11
12impl Platform for Lazada {
13 fn id(&self) -> &'static str {
14 "lazada"
15 }
16
17 fn name(&self) -> &'static str {
18 "Lazada"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["lazada.com", "lazada.co.th", "lazada.sg", "lazada.com.my", "lazada.ph", "lazada.co.id", "lazada.vn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Lazada = Lazada;
Added lib/social/src/parse/letv.rs lib/social/src/parse/letv.rs +34 −0 View lib/social/src/parse/letv.rs
@@ -0,0 +1,34 @@
1//! 乐视视频 — 视频 — le.com, letv.com
2//!
3//! letv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 乐视视频 — 视频 — le.com, letv.com
10pub struct Letv;
11
12impl Platform for Letv {
13 fn id(&self) -> &'static str {
14 "letv"
15 }
16
17 fn name(&self) -> &'static str {
18 "乐视视频"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["le.com", "letv.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Letv = Letv;
Added lib/social/src/parse/line.rs lib/social/src/parse/line.rs +34 −0 View lib/social/src/parse/line.rs
@@ -0,0 +1,34 @@
1//! LINE — 社交 — line.me, line-apps.com
2//!
3//! line
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// LINE — 社交 — line.me, line-apps.com
10pub struct Line;
11
12impl Platform for Line {
13 fn id(&self) -> &'static str {
14 "line"
15 }
16
17 fn name(&self) -> &'static str {
18 "LINE"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["line.me", "line-apps.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Line = Line;
Added lib/social/src/parse/line_music.rs lib/social/src/parse/line_music.rs +34 −0 View lib/social/src/parse/line_music.rs
@@ -0,0 +1,34 @@
1//! LINE MUSIC — 音乐 — music.line.me
2//!
3//! line-music
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// LINE MUSIC — 音乐 — music.line.me
10pub struct LineMusic;
11
12impl Platform for LineMusic {
13 fn id(&self) -> &'static str {
14 "line-music"
15 }
16
17 fn name(&self) -> &'static str {
18 "LINE MUSIC"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["music.line.me"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: LineMusic = LineMusic;
Added lib/social/src/parse/linear.rs lib/social/src/parse/linear.rs +34 −0 View lib/social/src/parse/linear.rs
@@ -0,0 +1,34 @@
1//! Linear — 开发 — linear.app
2//!
3//! linear
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Linear — 开发 — linear.app
10pub struct Linear;
11
12impl Platform for Linear {
13 fn id(&self) -> &'static str {
14 "linear"
15 }
16
17 fn name(&self) -> &'static str {
18 "Linear"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["linear.app"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Linear = Linear;
Added lib/social/src/parse/linetv.rs lib/social/src/parse/linetv.rs +34 −0 View lib/social/src/parse/linetv.rs
@@ -0,0 +1,34 @@
1//! LINE TV — 视频 — linetv.tw
2//!
3//! linetv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// LINE TV — 视频 — linetv.tw
10pub struct Linetv;
11
12impl Platform for Linetv {
13 fn id(&self) -> &'static str {
14 "linetv"
15 }
16
17 fn name(&self) -> &'static str {
18 "LINE TV"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["linetv.tw"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Linetv = Linetv;
Added lib/social/src/parse/linkedin.rs lib/social/src/parse/linkedin.rs +34 −0 View lib/social/src/parse/linkedin.rs
@@ -0,0 +1,34 @@
1//! LinkedIn — 社交 — linkedin.com, lnkd.in
2//!
3//! linkedin
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// LinkedIn — 社交 — linkedin.com, lnkd.in
10pub struct Linkedin;
11
12impl Platform for Linkedin {
13 fn id(&self) -> &'static str {
14 "linkedin"
15 }
16
17 fn name(&self) -> &'static str {
18 "LinkedIn"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["linkedin.com", "lnkd.in"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Linkedin = Linkedin;
Added lib/social/src/parse/lizhi.rs lib/social/src/parse/lizhi.rs +34 −0 View lib/social/src/parse/lizhi.rs
@@ -0,0 +1,34 @@
1//! 荔枝FM — 音乐 — lizhi.fm
2//!
3//! lizhi
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 荔枝FM — 音乐 — lizhi.fm
10pub struct Lizhi;
11
12impl Platform for Lizhi {
13 fn id(&self) -> &'static str {
14 "lizhi"
15 }
16
17 fn name(&self) -> &'static str {
18 "荔枝FM"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["lizhi.fm"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Lizhi = Lizhi;
Added lib/social/src/parse/lkong.rs lib/social/src/parse/lkong.rs +34 −0 View lib/social/src/parse/lkong.rs
@@ -0,0 +1,34 @@
1//! 龙空 — 论坛 — lkong.com, longkong.cn
2//!
3//! lkong
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 龙空 — 论坛 — lkong.com, longkong.cn
10pub struct Lkong;
11
12impl Platform for Lkong {
13 fn id(&self) -> &'static str {
14 "lkong"
15 }
16
17 fn name(&self) -> &'static str {
18 "龙空"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["lkong.com", "longkong.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Lkong = Lkong;
Added lib/social/src/parse/llvm.rs lib/social/src/parse/llvm.rs +34 −0 View lib/social/src/parse/llvm.rs
@@ -0,0 +1,34 @@
1//! LLVM — 开发 — llvm.org
2//!
3//! llvm
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// LLVM — 开发 — llvm.org
10pub struct Llvm;
11
12impl Platform for Llvm {
13 fn id(&self) -> &'static str {
14 "llvm"
15 }
16
17 fn name(&self) -> &'static str {
18 "LLVM"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["llvm.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Llvm = Llvm;
Added lib/social/src/parse/lobsters.rs lib/social/src/parse/lobsters.rs +34 −0 View lib/social/src/parse/lobsters.rs
@@ -0,0 +1,34 @@
1//! Lobsters — 论坛 — lobste.rs
2//!
3//! lobsters
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Lobsters — 论坛 — lobste.rs
10pub struct Lobsters;
11
12impl Platform for Lobsters {
13 fn id(&self) -> &'static str {
14 "lobsters"
15 }
16
17 fn name(&self) -> &'static str {
18 "Lobsters"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["lobste.rs"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Lobsters = Lobsters;
Added lib/social/src/parse/lofter.rs lib/social/src/parse/lofter.rs +34 −0 View lib/social/src/parse/lofter.rs
@@ -0,0 +1,34 @@
1//! LOFTER — 社交 — lofter.com
2//!
3//! lofter
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// LOFTER — 社交 — lofter.com
10pub struct Lofter;
11
12impl Platform for Lofter {
13 fn id(&self) -> &'static str {
14 "lofter"
15 }
16
17 fn name(&self) -> &'static str {
18 "LOFTER"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["lofter.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Lofter = Lofter;
Added lib/social/src/parse/longzhu.rs lib/social/src/parse/longzhu.rs +34 −0 View lib/social/src/parse/longzhu.rs
@@ -0,0 +1,34 @@
1//! 龙珠直播 — 直播 — longzhu.com
2//!
3//! longzhu
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 龙珠直播 — 直播 — longzhu.com
10pub struct Longzhu;
11
12impl Platform for Longzhu {
13 fn id(&self) -> &'static str {
14 "longzhu"
15 }
16
17 fn name(&self) -> &'static str {
18 "龙珠直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["longzhu.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Longzhu = Longzhu;
Added lib/social/src/parse/luckin.rs lib/social/src/parse/luckin.rs +34 −0 View lib/social/src/parse/luckin.rs
@@ -0,0 +1,34 @@
1//! 瑞幸咖啡 — 电商 — luckincoffee.com, lkcoffee.com
2//!
3//! luckin
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 瑞幸咖啡 — 电商 — luckincoffee.com, lkcoffee.com
10pub struct Luckin;
11
12impl Platform for Luckin {
13 fn id(&self) -> &'static str {
14 "luckin"
15 }
16
17 fn name(&self) -> &'static str {
18 "瑞幸咖啡"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["luckincoffee.com", "lkcoffee.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Luckin = Luckin;
Added lib/social/src/parse/maimai.rs lib/social/src/parse/maimai.rs +34 −0 View lib/social/src/parse/maimai.rs
@@ -0,0 +1,34 @@
1//! 脉脉 — 社交 — maimai.cn
2//!
3//! maimai
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 脉脉 — 社交 — maimai.cn
10pub struct Maimai;
11
12impl Platform for Maimai {
13 fn id(&self) -> &'static str {
14 "maimai"
15 }
16
17 fn name(&self) -> &'static str {
18 "脉脉"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["maimai.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Maimai = Maimai;
Added lib/social/src/parse/mastodon.rs lib/social/src/parse/mastodon.rs +33 −0 View lib/social/src/parse/mastodon.rs
@@ -0,0 +1,33 @@
1//! Mastodon — 社交 — mastodon.social, mastodon.online, mstdn.social, mastodon.world, pawoo.net, fosstodon.org
2//!
3//! mastodon
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Mastodon — 社交 — mastodon.social, mastodon.online, mstdn.social, mastodon.world, pawoo.net, fosstodon.org
9pub struct Mastodon;
10
11impl Platform for Mastodon {
12 fn id(&self) -> &'static str {
13 "mastodon"
14 }
15
16 fn name(&self) -> &'static str {
17 "Mastodon"
18 }
19
20 fn category(&self) -> Category {
21 Category::Social
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["mastodon.social", "mastodon.online", "mstdn.social", "mastodon.world", "pawoo.net", "fosstodon.org"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://{host}{path}/embed"))
30 }
31}
32
33pub static PLATFORM: Mastodon = Mastodon;
Added lib/social/src/parse/max.rs lib/social/src/parse/max.rs +34 −0 View lib/social/src/parse/max.rs
@@ -0,0 +1,34 @@
1//! Max — 视频 — max.com, hbomax.com
2//!
3//! max
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Max — 视频 — max.com, hbomax.com
10pub struct Max;
11
12impl Platform for Max {
13 fn id(&self) -> &'static str {
14 "max"
15 }
16
17 fn name(&self) -> &'static str {
18 "Max"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["max.com", "hbomax.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Max = Max;
Added lib/social/src/parse/mcdonalds.rs lib/social/src/parse/mcdonalds.rs +34 −0 View lib/social/src/parse/mcdonalds.rs
@@ -0,0 +1,34 @@
1//! 麦当劳 — 电商 — mcdonalds.com.cn, mcdonalds.com
2//!
3//! mcdonalds
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 麦当劳 — 电商 — mcdonalds.com.cn, mcdonalds.com
10pub struct Mcdonalds;
11
12impl Platform for Mcdonalds {
13 fn id(&self) -> &'static str {
14 "mcdonalds"
15 }
16
17 fn name(&self) -> &'static str {
18 "麦当劳"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mcdonalds.com.cn", "mcdonalds.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mcdonalds = Mcdonalds;
Added lib/social/src/parse/mdn.rs lib/social/src/parse/mdn.rs +34 −0 View lib/social/src/parse/mdn.rs
@@ -0,0 +1,34 @@
1//! MDN — 开发 — developer.mozilla.org, mdn.mozilla.org, mdn.dev
2//!
3//! mdn
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// MDN — 开发 — developer.mozilla.org, mdn.mozilla.org, mdn.dev
10pub struct Mdn;
11
12impl Platform for Mdn {
13 fn id(&self) -> &'static str {
14 "mdn"
15 }
16
17 fn name(&self) -> &'static str {
18 "MDN"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["developer.mozilla.org", "mdn.mozilla.org", "mdn.dev"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mdn = Mdn;
Added lib/social/src/parse/medium.rs lib/social/src/parse/medium.rs +34 −0 View lib/social/src/parse/medium.rs
@@ -0,0 +1,34 @@
1//! Medium — 新闻 — medium.com, towardsdatascience.com
2//!
3//! medium
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Medium — 新闻 — medium.com, towardsdatascience.com
10pub struct Medium;
11
12impl Platform for Medium {
13 fn id(&self) -> &'static str {
14 "medium"
15 }
16
17 fn name(&self) -> &'static str {
18 "Medium"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["medium.com", "towardsdatascience.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Medium = Medium;
Added lib/social/src/parse/meetup.rs lib/social/src/parse/meetup.rs +34 −0 View lib/social/src/parse/meetup.rs
@@ -0,0 +1,34 @@
1//! Meetup — 社交 — meetup.com
2//!
3//! meetup
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Meetup — 社交 — meetup.com
10pub struct Meetup;
11
12impl Platform for Meetup {
13 fn id(&self) -> &'static str {
14 "meetup"
15 }
16
17 fn name(&self) -> &'static str {
18 "Meetup"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["meetup.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Meetup = Meetup;
Added lib/social/src/parse/meipai.rs lib/social/src/parse/meipai.rs +34 −0 View lib/social/src/parse/meipai.rs
@@ -0,0 +1,34 @@
1//! 美拍 — 视频 — meipai.com
2//!
3//! meipai
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 美拍 — 视频 — meipai.com
10pub struct Meipai;
11
12impl Platform for Meipai {
13 fn id(&self) -> &'static str {
14 "meipai"
15 }
16
17 fn name(&self) -> &'static str {
18 "美拍"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["meipai.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Meipai = Meipai;
Added lib/social/src/parse/meituan.rs lib/social/src/parse/meituan.rs +34 −0 View lib/social/src/parse/meituan.rs
@@ -0,0 +1,34 @@
1//! 美团 — 电商 — meituan.com, meituan.net, dianping.com
2//!
3//! meituan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 美团 — 电商 — meituan.com, meituan.net, dianping.com
10pub struct Meituan;
11
12impl Platform for Meituan {
13 fn id(&self) -> &'static str {
14 "meituan"
15 }
16
17 fn name(&self) -> &'static str {
18 "美团"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["meituan.com", "meituan.net", "dianping.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Meituan = Meituan;
Added lib/social/src/parse/mercadolibre.rs lib/social/src/parse/mercadolibre.rs +34 −0 View lib/social/src/parse/mercadolibre.rs
@@ -0,0 +1,34 @@
1//! Mercado Libre — 电商 — mercadolibre.com, mercadolivre.com.br, mercadolibre.com.mx, mercadolibre.com.ar, mercadolibre.cl, mercadolibre.com.co, mercadolibre.com.pe
2//!
3//! mercadolibre
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Mercado Libre — 电商 — mercadolibre.com, mercadolivre.com.br, mercadolibre.com.mx, mercadolibre.com.ar, mercadolibre.cl, mercadolibre.com.co, mercadolibre.com.pe
10pub struct Mercadolibre;
11
12impl Platform for Mercadolibre {
13 fn id(&self) -> &'static str {
14 "mercadolibre"
15 }
16
17 fn name(&self) -> &'static str {
18 "Mercado Libre"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mercadolibre.com", "mercadolivre.com.br", "mercadolibre.com.mx", "mercadolibre.com.ar", "mercadolibre.cl", "mercadolibre.com.co", "mercadolibre.com.pe"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mercadolibre = Mercadolibre;
Added lib/social/src/parse/metacafe.rs lib/social/src/parse/metacafe.rs +34 −0 View lib/social/src/parse/metacafe.rs
@@ -0,0 +1,34 @@
1//! Metacafe — 视频 — metacafe.com
2//!
3//! metacafe
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Metacafe — 视频 — metacafe.com
10pub struct Metacafe;
11
12impl Platform for Metacafe {
13 fn id(&self) -> &'static str {
14 "metacafe"
15 }
16
17 fn name(&self) -> &'static str {
18 "Metacafe"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["metacafe.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Metacafe = Metacafe;
Added lib/social/src/parse/metafilter.rs lib/social/src/parse/metafilter.rs +34 −0 View lib/social/src/parse/metafilter.rs
@@ -0,0 +1,34 @@
1//! MetaFilter — 论坛 — metafilter.com
2//!
3//! metafilter
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// MetaFilter — 论坛 — metafilter.com
10pub struct Metafilter;
11
12impl Platform for Metafilter {
13 fn id(&self) -> &'static str {
14 "metafilter"
15 }
16
17 fn name(&self) -> &'static str {
18 "MetaFilter"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["metafilter.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Metafilter = Metafilter;
Added lib/social/src/parse/mgtv.rs lib/social/src/parse/mgtv.rs +34 −0 View lib/social/src/parse/mgtv.rs
@@ -0,0 +1,34 @@
1//! 芒果TV — 视频 — mgtv.com
2//!
3//! mgtv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 芒果TV — 视频 — mgtv.com
10pub struct Mgtv;
11
12impl Platform for Mgtv {
13 fn id(&self) -> &'static str {
14 "mgtv"
15 }
16
17 fn name(&self) -> &'static str {
18 "芒果TV"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mgtv.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mgtv = Mgtv;
Added lib/social/src/parse/mi_store.rs lib/social/src/parse/mi_store.rs +34 −0 View lib/social/src/parse/mi_store.rs
@@ -0,0 +1,34 @@
1//! 小米商城 — 电商 — mi.com, xiaomiyoupin.com
2//!
3//! mi-store
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 小米商城 — 电商 — mi.com, xiaomiyoupin.com
10pub struct MiStore;
11
12impl Platform for MiStore {
13 fn id(&self) -> &'static str {
14 "mi-store"
15 }
16
17 fn name(&self) -> &'static str {
18 "小米商城"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mi.com", "xiaomiyoupin.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: MiStore = MiStore;
Added lib/social/src/parse/miaopai.rs lib/social/src/parse/miaopai.rs +34 −0 View lib/social/src/parse/miaopai.rs
@@ -0,0 +1,34 @@
1//! 秒拍 — 视频 — miaopai.com
2//!
3//! miaopai
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 秒拍 — 视频 — miaopai.com
10pub struct Miaopai;
11
12impl Platform for Miaopai {
13 fn id(&self) -> &'static str {
14 "miaopai"
15 }
16
17 fn name(&self) -> &'static str {
18 "秒拍"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["miaopai.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Miaopai = Miaopai;
Added lib/social/src/parse/microsoft.rs lib/social/src/parse/microsoft.rs +34 −0 View lib/social/src/parse/microsoft.rs
@@ -0,0 +1,34 @@
1//! Microsoft — 开发 — microsoft.com, learn.microsoft.com, azure.com
2//!
3//! microsoft
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Microsoft — 开发 — microsoft.com, learn.microsoft.com, azure.com
10pub struct Microsoft;
11
12impl Platform for Microsoft {
13 fn id(&self) -> &'static str {
14 "microsoft"
15 }
16
17 fn name(&self) -> &'static str {
18 "Microsoft"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["microsoft.com", "learn.microsoft.com", "azure.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Microsoft = Microsoft;
Added lib/social/src/parse/migu_music.rs lib/social/src/parse/migu_music.rs +34 −0 View lib/social/src/parse/migu_music.rs
@@ -0,0 +1,34 @@
1//! 咪咕音乐 — 音乐 — music.migu.cn
2//!
3//! migu-music
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 咪咕音乐 — 音乐 — music.migu.cn
10pub struct MiguMusic;
11
12impl Platform for MiguMusic {
13 fn id(&self) -> &'static str {
14 "migu-music"
15 }
16
17 fn name(&self) -> &'static str {
18 "咪咕音乐"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["music.migu.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: MiguMusic = MiguMusic;
Added lib/social/src/parse/migu_video.rs lib/social/src/parse/migu_video.rs +34 −0 View lib/social/src/parse/migu_video.rs
@@ -0,0 +1,34 @@
1//! 咪咕视频 — 视频 — miguvideo.com
2//!
3//! migu-video
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 咪咕视频 — 视频 — miguvideo.com
10pub struct MiguVideo;
11
12impl Platform for MiguVideo {
13 fn id(&self) -> &'static str {
14 "migu-video"
15 }
16
17 fn name(&self) -> &'static str {
18 "咪咕视频"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["miguvideo.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: MiguVideo = MiguVideo;
Added lib/social/src/parse/mildom.rs lib/social/src/parse/mildom.rs +34 −0 View lib/social/src/parse/mildom.rs
@@ -0,0 +1,34 @@
1//! Mildom — 直播 — mildom.com
2//!
3//! mildom
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Mildom — 直播 — mildom.com
10pub struct Mildom;
11
12impl Platform for Mildom {
13 fn id(&self) -> &'static str {
14 "mildom"
15 }
16
17 fn name(&self) -> &'static str {
18 "Mildom"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mildom.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mildom = Mildom;
Added lib/social/src/parse/miro.rs lib/social/src/parse/miro.rs +39 −0 View lib/social/src/parse/miro.rs
@@ -0,0 +1,39 @@
1//! Miro — 开发 — miro.com
2//!
3//! miro
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Miro — 开发 — miro.com
10pub struct Miro;
11
12impl Platform for Miro {
13 fn id(&self) -> &'static str {
14 "miro"
15 }
16
17 fn name(&self) -> &'static str {
18 "Miro"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["miro.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32 /// oEmbed 接口,聊天侧联网补全标题 / 简介 / 封面(iframe 仅在平台自有域名下采用)。
33 fn oembed(&self) -> Option<&'static str> {
34 Some("https://miro.com/api/v1/oembed?url={url_enc}")
35 }
36
37}
38
39pub static PLATFORM: Miro = Miro;
Added lib/social/src/parse/mixcloud.rs lib/social/src/parse/mixcloud.rs +33 −0 View lib/social/src/parse/mixcloud.rs
@@ -0,0 +1,33 @@
1//! Mixcloud — 音乐 — mixcloud.com
2//!
3//! mixcloud
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Mixcloud — 音乐 — mixcloud.com
9pub struct Mixcloud;
10
11impl Platform for Mixcloud {
12 fn id(&self) -> &'static str {
13 "mixcloud"
14 }
15
16 fn name(&self) -> &'static str {
17 "Mixcloud"
18 }
19
20 fn category(&self) -> Category {
21 Category::Music
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["mixcloud.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://www.mixcloud.com/widget/iframe/?hide_cover=1&feed={url_enc}"))
30 }
31}
32
33pub static PLATFORM: Mixcloud = Mixcloud;
Added lib/social/src/parse/mixer.rs lib/social/src/parse/mixer.rs +34 −0 View lib/social/src/parse/mixer.rs
@@ -0,0 +1,34 @@
1//! Mixer — 直播 — mixer.com
2//!
3//! mixer
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Mixer — 直播 — mixer.com
10pub struct Mixer;
11
12impl Platform for Mixer {
13 fn id(&self) -> &'static str {
14 "mixer"
15 }
16
17 fn name(&self) -> &'static str {
18 "Mixer"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mixer.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mixer = Mixer;
Added lib/social/src/parse/mod.rs lib/social/src/parse/mod.rs +995 −0 View lib/social/src/parse/mod.rs
@@ -0,0 +1,995 @@
1//! 平台解析:通用 [`Platform`] trait + 正则路由。
2//!
3//! 每个平台一个文件(`parse/<id>.rs`):文件里只声明元数据 + 一条声明式
4//! [`EmbedRule`],声明式表达不了的平台可以覆写 [`Platform::parse`]。
5//!
6//! 路由对每个域名编译一条正则 `(^|\.)example\.com$`,域名越长越优先,
7//! 命中的平台再套自己的规则拼出 iframe src。全程不联网。
8
9use std::collections::HashMap;
10use std::sync::{OnceLock, RwLock};
11
12use percent_encoding::{AsciiSet, CONTROLS, utf8_percent_encode};
13use regex::Regex;
14use url::Url;
15
16use crate::{Aspect, Category, EmbedKind, Resolved};
17
18/// 用于路径参数编码:保留 URL 路径/查询里安全且常见的 `-_.~`。
19const COMPONENT: &AsciiSet = &CONTROLS
20 .add(b' ')
21 .add(b'"')
22 .add(b'#')
23 .add(b'%')
24 .add(b'&')
25 .add(b'\'')
26 .add(b'(')
27 .add(b')')
28 .add(b'*')
29 .add(b'+')
30 .add(b',')
31 .add(b'/')
32 .add(b':')
33 .add(b';')
34 .add(b'<')
35 .add(b'=')
36 .add(b'>')
37 .add(b'?')
38 .add(b'@')
39 .add(b'[')
40 .add(b'\\')
41 .add(b']')
42 .add(b'^')
43 .add(b'`')
44 .add(b'{')
45 .add(b'|')
46 .add(b'}');
47
48/// 一条声明式嵌入规则:从页面 URL 拼出 iframe `src`。
49///
50/// `pattern` 为 `None` 时直接用原 URL 拼模板;否则先把 `pattern` 应用到
51/// `path?query#frag` 上抽捕获组,抽不到就退化成卡片。
52#[derive(Debug, Clone, Copy, PartialEq, Eq)]
53pub struct EmbedRule {
54 /// 对 `path?query#frag` 匹配的正则。
55 pub pattern: Option<&'static str>,
56 /// `src` 模板:`{url}` / `{url_enc}` / `{path}` / `{host}` / `{query}` / `{frag}`,
57 /// 以及正则捕获组 `{id}`(等价 `{1}`)、`{2}`…`{9}`(自动 percent-encode)。
58 pub src: &'static str,
59 pub aspect: Aspect,
60}
61
62impl EmbedRule {
63 /// 不抽参数,直接用原 URL 拼模板。
64 pub const fn frame(src: &'static str) -> Self {
65 Self {
66 pattern: None,
67 src,
68 aspect: Aspect::Wide,
69 }
70 }
71
72 /// 同 [`EmbedRule::frame`],但指定宽高比。
73 pub const fn frame_with(src: &'static str, aspect: Aspect) -> Self {
74 Self {
75 pattern: None,
76 src,
77 aspect,
78 }
79 }
80
81 /// 指定正则与宽高比。
82 pub const fn capture(pattern: &'static str, src: &'static str, aspect: Aspect) -> Self {
83 Self {
84 pattern: Some(pattern),
85 src,
86 aspect,
87 }
88 }
89
90 /// 16:9 的正则规则。
91 pub const fn wide(pattern: &'static str, src: &'static str) -> Self {
92 Self::capture(pattern, src, Aspect::Wide)
93 }
94
95 /// 1:1 的正则规则。
96 pub const fn square(pattern: &'static str, src: &'static str) -> Self {
97 Self::capture(pattern, src, Aspect::Square)
98 }
99
100 /// 9:16(竖屏短视频、直播)的正则规则。
101 pub const fn vertical(pattern: &'static str, src: &'static str) -> Self {
102 Self::capture(pattern, src, Aspect::Vertical)
103 }
104
105 /// 4:5(信息流图片)的正则规则。
106 pub const fn tall(pattern: &'static str, src: &'static str) -> Self {
107 Self::capture(pattern, src, Aspect::Tall)
108 }
109}
110
111/// 一个可解析的站点。
112///
113/// - 站点禁止内嵌:`embed_rule` 返回 `None`,渲染成带平台标识的卡片。
114/// - 声明式规则够用:只实现 [`Platform::embed_rule`]。
115/// - 规则表达不了(多域名不同形状、需要多段拼装等):覆写 [`Platform::parse`],
116/// 用 [`capture_args`] + [`platform_resolved`] 组装结果。
117pub trait Platform: Sync + 'static {
118 /// 稳定标识,会进 embed JSON。
119 fn id(&self) -> &'static str;
120 /// 展示名。
121 fn name(&self) -> &'static str;
122 fn category(&self) -> Category;
123 /// 域名后缀,命中规则见 [`route`]。
124 fn domains(&self) -> &'static [&'static str];
125 /// 声明式规则;`None` 表示只能出卡片。
126 fn embed_rule(&self) -> Option<EmbedRule> {
127 None
128 }
129 /// oEmbed 端点模板(`{url}` / `{url_enc}` 占位)。有值的平台,
130 /// chat 侧可以联网补全标题、封面和作者。
131 fn oembed(&self) -> Option<&'static str> {
132 None
133 }
134 /// 解析入口,默认实现走 [`default_parse`]。
135 fn parse(&self, url: &Url) -> Option<Resolved> {
136 default_parse(self, url)
137 }
138}
139
140struct Route {
141 host: Regex,
142 platform: &'static dyn Platform,
143 domain_len: usize,
144}
145
146fn routes() -> &'static [Route] {
147 static CACHE: OnceLock<Vec<Route>> = OnceLock::new();
148 CACHE.get_or_init(|| {
149 let mut routes = Vec::new();
150 for platform in PLATFORMS {
151 for domain in platform.domains() {
152 let pattern = format!(r"(^|\.){}$", regex::escape(domain));
153 let Ok(host) = Regex::new(&pattern) else {
154 continue;
155 };
156 routes.push(Route {
157 host,
158 platform: *platform,
159 domain_len: domain.len(),
160 });
161 }
162 }
163 // 域名越长越优先;稳定排序保证同长度时先注册的平台先命中。
164 routes.sort_by(|left, right| right.domain_len.cmp(&left.domain_len));
165 routes
166 })
167}
168
169fn normalize_host(host: &str) -> String {
170 host.trim_end_matches('.').to_ascii_lowercase()
171}
172
173/// 按域名正则把 URL 路由到平台。
174pub fn route(url: &Url) -> Option<&'static dyn Platform> {
175 let host = normalize_host(url.host_str()?);
176 routes()
177 .iter()
178 .find(|route| route.host.is_match(&host))
179 .map(|route| route.platform)
180}
181
182/// 平台声明的 oEmbed 端点(占位符已按 URL 填好)。
183#[derive(Debug, Clone, PartialEq, Eq)]
184pub struct OembedEndpoint {
185 pub platform: &'static str,
186 pub platform_name: &'static str,
187 pub domains: &'static [&'static str],
188 pub endpoint: String,
189}
190
191/// URL 命中的平台若声明了 oEmbed 端点,返回可直接请求的地址。
192pub fn oembed_endpoint(url: &Url) -> Option<OembedEndpoint> {
193 let platform = route(url)?;
194 let template = platform.oembed()?;
195 Some(OembedEndpoint {
196 platform: platform.id(),
197 platform_name: platform.name(),
198 domains: platform.domains(),
199 endpoint: substitute(template, url, &[]),
200 })
201}
202
203/// 全部平台,顺序与 `parse/` 目录一致。
204pub fn providers() -> &'static [&'static dyn Platform] {
205 PLATFORMS
206}
207
208/// 平台总数。
209pub fn provider_count() -> usize {
210 PLATFORMS.len()
211}
212
213fn target_of(url: &Url) -> String {
214 let mut target = url.path().to_string();
215 if let Some(query) = url.query() {
216 target.push('?');
217 target.push_str(query);
218 }
219 if let Some(fragment) = url.fragment() {
220 target.push('#');
221 target.push_str(fragment);
222 }
223 target
224}
225
226fn pattern_regex(pattern: &'static str) -> Option<Regex> {
227 static CACHE: OnceLock<RwLock<HashMap<&'static str, Regex>>> = OnceLock::new();
228 let cache = CACHE.get_or_init(|| RwLock::new(HashMap::new()));
229 if let Some(regex) = cache
230 .read()
231 .ok()
232 .and_then(|guard| guard.get(pattern).cloned())
233 {
234 return Some(regex);
235 }
236 let regex = Regex::new(pattern).ok()?;
237 if let Ok(mut guard) = cache.write() {
238 guard.insert(pattern, regex.clone());
239 }
240 Some(regex)
241}
242
243/// 按 `pattern` 从 `path?query#frag` 抽取捕获组。
244pub fn capture_args(pattern: &'static str, url: &Url) -> Option<Vec<String>> {
245 let regex = pattern_regex(pattern)?;
246 let target = target_of(url);
247 let captures = regex.captures(&target)?;
248 Some(
249 captures
250 .iter()
251 .skip(1)
252 .map(|group| {
253 group
254 .map(|hit| hit.as_str().to_string())
255 .unwrap_or_default()
256 })
257 .collect(),
258 )
259}
260
261fn encode_component(value: &str) -> String {
262 utf8_percent_encode(value, COMPONENT).to_string()
263}
264
265fn substitute(template: &str, url: &Url, caps: &[String]) -> String {
266 let mut out = String::with_capacity(template.len() + 32);
267 let mut rest = template;
268 while let Some(start) = rest.find('{') {
269 out.push_str(&rest[..start]);
270 let after = &rest[start + 1..];
271 let Some(end) = after.find('}') else {
272 out.push_str(&rest[start..]);
273 return out;
274 };
275 let key = &after[..end];
276 match key {
277 "url" => out.push_str(url.as_str()),
278 "url_enc" => out.push_str(&encode_component(url.as_str())),
279 "path" => out.push_str(url.path()),
280 "host" => out.push_str(url.host_str().unwrap_or_default()),
281 "query" => out.push_str(url.query().unwrap_or_default()),
282 "frag" => out.push_str(url.fragment().unwrap_or_default()),
283 other => {
284 let index = if other == "id" {
285 Some(1usize)
286 } else {
287 other.parse::<usize>().ok()
288 };
289 match index.and_then(|index| caps.get(index - 1)) {
290 Some(value) => out.push_str(&encode_component(value)),
291 None => out.push_str(&rest[start..start + end + 2]),
292 }
293 }
294 }
295 rest = &after[end + 1..];
296 }
297 out.push_str(rest);
298 out
299}
300
301/// 组装一个解析结果,供自定义 [`Platform::parse`] 使用。
302pub fn platform_resolved<P: Platform + ?Sized>(
303 platform: &P,
304 url: &Url,
305 kind: EmbedKind,
306 src: Option<String>,
307 aspect: Aspect,
308) -> Resolved {
309 Resolved {
310 platform: platform.id(),
311 platform_name: platform.name(),
312 category: platform.category(),
313 kind,
314 url: url.to_string(),
315 src,
316 aspect,
317 title: platform.name().to_string(),
318 description: None,
319 image_url: None,
320 }
321}
322
323/// 默认解析:按 [`Platform::embed_rule`] 拼 src,抽不到参数或没有规则就出卡片。
324pub fn default_parse<P: Platform + ?Sized>(platform: &P, url: &Url) -> Option<Resolved> {
325 let Some(rule) = platform.embed_rule() else {
326 return Some(platform_resolved(
327 platform,
328 url,
329 EmbedKind::Link,
330 None,
331 Aspect::Auto,
332 ));
333 };
334 match rule.pattern {
335 None => Some(platform_resolved(
336 platform,
337 url,
338 EmbedKind::Iframe,
339 Some(substitute(rule.src, url, &[])),
340 rule.aspect,
341 )),
342 Some(pattern) => match capture_args(pattern, url) {
343 Some(caps) => Some(platform_resolved(
344 platform,
345 url,
346 EmbedKind::Iframe,
347 Some(substitute(rule.src, url, &caps)),
348 rule.aspect,
349 )),
350 None => Some(platform_resolved(
351 platform,
352 url,
353 EmbedKind::Link,
354 None,
355 Aspect::Auto,
356 )),
357 },
358 }
359}
360
361macro_rules! platforms {
362 ($($module:ident),* $(,)?) => {
363 $(
364 pub mod $module;
365 )*
366
367 /// 全部平台,顺序与 `parse/` 目录一致。
368 pub static PLATFORMS: &[&'static dyn Platform] = &[$(&$module::PLATFORM),*];
369 };
370}
371
372// --- 生成区域开始(每个平台一个模块,勿手改)---
373platforms! {
374 wechat,
375 wechat_work,
376 wechat_channels,
377 dingtalk,
378 feishu,
379 douyin,
380 weibo,
381 xiaohongshu,
382 kuaishou,
383 momo,
384 tantan,
385 maimai,
386 jike,
387 zuiyou,
388 pipixia,
389 lofter,
390 jianshu,
391 renren,
392 kaixin,
393 qzone,
394 qq,
395 facebook,
396 instagram,
397 twitter,
398 tiktok,
399 threads,
400 bluesky,
401 mastodon,
402 linkedin,
403 telegram,
404 discord,
405 discord_invite,
406 snapchat,
407 pinterest,
408 tumblr,
409 vk,
410 line,
411 whatsapp,
412 viber,
413 kik,
414 pixiv,
415 weheartit,
416 askfm,
417 plurk,
418 badoo,
419 meetup,
420 nextdoor,
421 tinder,
422 bumble,
423 clubhouse,
424 gab,
425 truthsocial,
426 yikyak,
427 douban,
428 taobao,
429 tmall,
430 jd,
431 pinduoduo,
432 meituan,
433 eleme,
434 alipay,
435 xianyu,
436 zhuanzhuan,
437 suning,
438 vip,
439 dewu,
440 mogujie,
441 secoo,
442 dangdang,
443 gome,
444 jumei,
445 yhd,
446 mi_store,
447 vmall,
448 yanxuan,
449 p58,
450 ganji,
451 ctrip,
452 qunar,
453 fliggy,
454 kfc,
455 mcdonalds,
456 starbucks,
457 luckin,
458 amazon,
459 ebay,
460 etsy,
461 shopify,
462 walmart,
463 aliexpress,
464 p1688,
465 rakuten,
466 mercadolibre,
467 flipkart,
468 lazada,
469 shopee,
470 tokopedia,
471 coupang,
472 zalando,
473 asos,
474 target,
475 bestbuy,
476 homedepot,
477 costco,
478 ikea,
479 nike,
480 adidas,
481 sephora,
482 airbnb,
483 booking,
484 agoda,
485 expedia,
486 tripadvisor,
487 doordash,
488 ubereats,
489 grubhub,
490 instacart,
491 bilibili,
492 b23,
493 acfun,
494 iqiyi,
495 youku,
496 qqvideo,
497 mgtv,
498 sohutv,
499 letv,
500 tudou,
501 pptv,
502 migu_video,
503 xigua,
504 haokan,
505 miaopai,
506 meipai,
507 weishi,
508 p56,
509 p6rooms,
510 huoshan,
511 youtube,
512 youtu_short,
513 youtube_music,
514 vimeo,
515 dailymotion,
516 netflix,
517 hulu,
518 disneyplus,
519 max,
520 primevideo,
521 crunchyroll,
522 funimation,
523 vevo,
524 ted,
525 nicovideo,
526 peacock,
527 paramount,
528 appletv,
529 hotstar,
530 zee5,
531 viki,
532 wetv,
533 linetv,
534 kktv,
535 hanju,
536 odysee,
537 rumble,
538 bitchute,
539 veoh,
540 metacafe,
541 archive,
542 netease_music,
543 qqmusic,
544 kugou,
545 kuwo,
546 xiami,
547 migu_music,
548 qianqian,
549 ximalaya,
550 lizhi,
551 qingting,
552 dedao,
553 xiaoyuzhou,
554 p5sing,
555 quanmin,
556 changba,
557 spotify,
558 applemusic,
559 soundcloud,
560 bandcamp,
561 deezer,
562 tidal,
563 amazonmusic,
564 pandora,
565 iheartradio,
566 mixcloud,
567 audiomack,
568 napster,
569 qobuz,
570 joox,
571 kkbox,
572 line_music,
573 awa,
574 anghami,
575 boomplay,
576 audius,
577 podbean,
578 anchor,
579 baidu,
580 baijiahao,
581 sina_news,
582 netease_news,
583 qq_news,
584 sohu,
585 ifeng,
586 thepaper,
587 jiemian,
588 caixin,
589 guancha,
590 huanqiu,
591 people,
592 xinhua,
593 cctv,
594 chinanews,
595 toutiao,
596 yidian,
597 zaker,
598 p36kr,
599 huxiu,
600 tmtpost,
601 sspai,
602 ifanr,
603 iyiou,
604 xueqiu,
605 eastmoney,
606 cls,
607 bbc,
608 cnn,
609 nytimes,
610 washingtonpost,
611 theguardian,
612 reuters,
613 apnews,
614 bloomberg,
615 wsj,
616 forbes,
617 techcrunch,
618 theverge,
619 wired,
620 hackernews,
621 medium,
622 substack,
623 zhihu,
624 zhihu_column,
625 tieba,
626 reddit,
627 reddit_short,
628 quora,
629 stackoverflow,
630 v2ex,
631 hupu,
632 nga,
633 tianya,
634 mop,
635 newsmth,
636 lkong,
637 tiexue,
638 discuz,
639 phpbb,
640 discourse,
641 p4chan,
642 somethingawful,
643 resetera,
644 neogaf,
645 enshan,
646 p52pojie,
647 kafan,
648 gfan,
649 coolapk,
650 lobsters,
651 slashdot,
652 digg,
653 metafilter,
654 bilibili_live,
655 douyin_live,
656 kuaishou_live,
657 taobao_live,
658 douyu,
659 huya,
660 yy,
661 huajiao,
662 inke,
663 qie,
664 longzhu,
665 zhanqi,
666 panda,
667 netease_cc,
668 twitch,
669 kick,
670 trovo,
671 dlive,
672 mixer,
673 nimotv,
674 bigo,
675 p17live,
676 uplive,
677 langlive,
678 soop,
679 showroom,
680 mildom,
681 wikipedia,
682 baike,
683 wenku,
684 baidupan,
685 baidumap,
686 baidu_search,
687 douban_book,
688 douban_movie,
689 guokr,
690 zcool,
691 huaban,
692 notion,
693 yuque,
694 obsidian,
695 gitbook,
696 arxiv,
697 scholar,
698 doi,
699 pubmed,
700 nature,
701 science,
702 ieee,
703 springer,
704 sciencedirect,
705 wiley,
706 cell,
707 britannica,
708 github,
709 gitlab,
710 gitee,
711 bitbucket,
712 sourceforge,
713 codepen,
714 jsfiddle,
715 codesandbox,
716 stackblitz,
717 replit,
718 glitch,
719 vercel,
720 netlify,
721 cloudflare,
722 dockerhub,
723 figma,
724 canva,
725 dribbble,
726 behance,
727 unsplash,
728 pexels,
729 pixabay,
730 producthunt,
731 devto,
732 hashnode,
733 huggingface,
734 openai,
735 anthropic,
736 replicate,
737 kaggle,
738 colab,
739 googledrive,
740 miro,
741 excalidraw,
742 whimsical,
743 trello,
744 asana,
745 monday,
746 atlassian,
747 linear,
748 airtable,
749 zapier,
750 ifttt,
751 postman,
752 swagger,
753 sentry,
754 datadog,
755 grafana,
756 elastic,
757 mongodb,
758 redis,
759 postgresql,
760 sqlite,
761 rustlang,
762 docsrs,
763 cratesio,
764 npm,
765 pypi,
766 python,
767 nodejs,
768 typescriptlang,
769 react,
770 vuejs,
771 svelte,
772 nextjs,
773 nuxt,
774 tauri,
775 electron,
776 flutter,
777 kotlin,
778 golang,
779 swift,
780 llvm,
781 debian,
782 ubuntu,
783 archlinux,
784 kernel,
785 android,
786 apple_dev,
787 microsoft,
788 mdn,
789 readthedocs,
790 csdn,
791 cnblogs,
792 juejin,
793 segmentfault,
794 infoq,
795 oschina,
796 googlemaps,
797}
798// --- 生成区域结束 ---
799
800#[cfg(test)]
801mod tests {
802 use super::*;
803
804 fn url_of(raw: &str) -> Url {
805 Url::parse(raw).expect("test url")
806 }
807
808 #[test]
809 fn longest_domain_wins() {
810 let wechat = route(&url_of("https://mp.weixin.qq.com/s/AbCdEfGhIjKlMn")).unwrap();
811 assert_eq!(wechat.id(), "wechat");
812 let qq = route(&url_of("https://im.qq.com/index")).unwrap();
813 assert_eq!(qq.id(), "qq");
814 assert!(route(&url_of("https://example.com/")).is_none());
815 }
816
817 #[test]
818 fn declared_patterns_compile() {
819 for platform in providers() {
820 if let Some(rule) = platform.embed_rule()
821 && let Some(pattern) = rule.pattern
822 {
823 assert!(
824 Regex::new(pattern).is_ok(),
825 "{} has an invalid pattern {pattern}",
826 platform.id()
827 );
828 }
829 }
830 }
831
832 #[test]
833 fn custom_parse_overrides_default() {
834 struct Custom;
835
836 impl Platform for Custom {
837 fn id(&self) -> &'static str {
838 "custom"
839 }
840
841 fn name(&self) -> &'static str {
842 "自定义"
843 }
844
845 fn category(&self) -> Category {
846 Category::Other
847 }
848
849 fn domains(&self) -> &'static [&'static str] {
850 &["custom.example"]
851 }
852
853 fn embed_rule(&self) -> Option<EmbedRule> {
854 None
855 }
856
857 fn parse(&self, url: &Url) -> Option<Resolved> {
858 let caps = capture_args(r"^/watch/([A-Za-z0-9]+)", url)?;
859 Some(platform_resolved(
860 self,
861 url,
862 EmbedKind::Iframe,
863 Some(format!("https://custom.example/embed/{}", caps[0])),
864 Aspect::Vertical,
865 ))
866 }
867 }
868
869 let resolved = Custom
870 .parse(&url_of("https://custom.example/watch/abc123"))
871 .unwrap();
872 assert_eq!(resolved.kind, EmbedKind::Iframe);
873 assert_eq!(
874 resolved.src.as_deref(),
875 Some("https://custom.example/embed/abc123")
876 );
877 assert_eq!(resolved.aspect, Aspect::Vertical);
878 assert!(
879 Custom
880 .parse(&url_of("https://custom.example/other"))
881 .is_none()
882 );
883 }
884
885 #[test]
886 fn default_parse_degrades_to_card() {
887 struct Carded;
888
889 impl Platform for Carded {
890 fn id(&self) -> &'static str {
891 "carded"
892 }
893
894 fn name(&self) -> &'static str {
895 "只有卡片"
896 }
897
898 fn category(&self) -> Category {
899 Category::News
900 }
901
902 fn domains(&self) -> &'static [&'static str] {
903 &["carded.example"]
904 }
905 }
906
907 let resolved = Carded.parse(&url_of("https://carded.example/a/b")).unwrap();
908 assert_eq!(resolved.kind, EmbedKind::Link);
909 assert!(resolved.src.is_none());
910 assert_eq!(resolved.title, "只有卡片");
911 }
912
913 #[test]
914 fn provider_index_is_wellformed() {
915 assert!(
916 provider_count() >= 300,
917 "expected at least 300 platforms, got {}",
918 provider_count()
919 );
920 let mut ids: Vec<&str> = providers().iter().map(|platform| platform.id()).collect();
921 ids.sort_unstable();
922 let before = ids.len();
923 ids.dedup();
924 assert_eq!(before, ids.len(), "duplicate platform ids");
925 for platform in providers() {
926 assert!(
927 !platform.domains().is_empty(),
928 "{} has no domains",
929 platform.id()
930 );
931 for domain in platform.domains() {
932 assert!(
933 !domain.contains('/')
934 && !domain.contains(':')
935 && !domain.contains(char::is_whitespace)
936 && domain.split('.').all(|label| !label.is_empty()),
937 "{} has a non-hostname domain {domain}",
938 platform.id()
939 );
940 }
941 }
942 }
943
944 /// oEmbed 端点必须是 https、带 `{url}`/`{url_enc}` 占位,否则 chat 侧抓不到东西。
945 #[test]
946 fn oembed_templates_are_complete() {
947 let mut declared = Vec::new();
948 for platform in providers() {
949 let Some(template) = platform.oembed() else {
950 continue;
951 };
952 declared.push(platform.id());
953 assert!(
954 template.starts_with("https://"),
955 "{} declares a non-https oembed endpoint {template}",
956 platform.id()
957 );
958 assert!(
959 template.contains("{url}") || template.contains("{url_enc}"),
960 "{} declares an oembed endpoint without a url placeholder",
961 platform.id()
962 );
963 }
964 assert!(
965 declared.len() >= 5,
966 "expected several oembed platforms, got {declared:?}"
967 );
968 }
969
970 /// oEmbed 接口必须挂在该平台自己声明的域名下(含子域),
971 /// 否则联网补全就成了替第三方站点发请求。
972 #[test]
973 fn oembed_endpoints_live_on_the_platform_own_domains() {
974 for platform in providers() {
975 let Some(template) = platform.oembed() else {
976 continue;
977 };
978 let host = template
979 .trim_start_matches("https://")
980 .split(['/', '?'])
981 .next()
982 .unwrap_or_default()
983 .to_ascii_lowercase();
984 assert!(!host.is_empty(), "{} declares an empty host", platform.id());
985 assert!(
986 platform
987 .domains()
988 .iter()
989 .any(|domain| host == *domain || host.ends_with(&format!(".{domain}"))),
990 "{} declares an oembed endpoint on a foreign host {host}",
991 platform.id()
992 );
993 }
994 }
995}
Added lib/social/src/parse/mogujie.rs lib/social/src/parse/mogujie.rs +34 −0 View lib/social/src/parse/mogujie.rs
@@ -0,0 +1,34 @@
1//! 蘑菇街 — 电商 — mogujie.com
2//!
3//! mogujie
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 蘑菇街 — 电商 — mogujie.com
10pub struct Mogujie;
11
12impl Platform for Mogujie {
13 fn id(&self) -> &'static str {
14 "mogujie"
15 }
16
17 fn name(&self) -> &'static str {
18 "蘑菇街"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mogujie.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mogujie = Mogujie;
Added lib/social/src/parse/momo.rs lib/social/src/parse/momo.rs +34 −0 View lib/social/src/parse/momo.rs
@@ -0,0 +1,34 @@
1//! 陌陌 — 社交 — immomo.com, momo.com
2//!
3//! momo
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 陌陌 — 社交 — immomo.com, momo.com
10pub struct Momo;
11
12impl Platform for Momo {
13 fn id(&self) -> &'static str {
14 "momo"
15 }
16
17 fn name(&self) -> &'static str {
18 "陌陌"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["immomo.com", "momo.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Momo = Momo;
Added lib/social/src/parse/monday.rs lib/social/src/parse/monday.rs +34 −0 View lib/social/src/parse/monday.rs
@@ -0,0 +1,34 @@
1//! monday.com — 开发 — monday.com
2//!
3//! monday
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// monday.com — 开发 — monday.com
10pub struct Monday;
11
12impl Platform for Monday {
13 fn id(&self) -> &'static str {
14 "monday"
15 }
16
17 fn name(&self) -> &'static str {
18 "monday.com"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["monday.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Monday = Monday;
Added lib/social/src/parse/mongodb.rs lib/social/src/parse/mongodb.rs +34 −0 View lib/social/src/parse/mongodb.rs
@@ -0,0 +1,34 @@
1//! MongoDB — 开发 — mongodb.com
2//!
3//! mongodb
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// MongoDB — 开发 — mongodb.com
10pub struct Mongodb;
11
12impl Platform for Mongodb {
13 fn id(&self) -> &'static str {
14 "mongodb"
15 }
16
17 fn name(&self) -> &'static str {
18 "MongoDB"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mongodb.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mongodb = Mongodb;
Added lib/social/src/parse/mop.rs lib/social/src/parse/mop.rs +34 −0 View lib/social/src/parse/mop.rs
@@ -0,0 +1,34 @@
1//! 猫扑 — 论坛 — mop.com
2//!
3//! mop
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 猫扑 — 论坛 — mop.com
10pub struct Mop;
11
12impl Platform for Mop {
13 fn id(&self) -> &'static str {
14 "mop"
15 }
16
17 fn name(&self) -> &'static str {
18 "猫扑"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["mop.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Mop = Mop;
Added lib/social/src/parse/napster.rs lib/social/src/parse/napster.rs +34 −0 View lib/social/src/parse/napster.rs
@@ -0,0 +1,34 @@
1//! Napster — 音乐 — napster.com
2//!
3//! napster
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Napster — 音乐 — napster.com
10pub struct Napster;
11
12impl Platform for Napster {
13 fn id(&self) -> &'static str {
14 "napster"
15 }
16
17 fn name(&self) -> &'static str {
18 "Napster"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["napster.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Napster = Napster;
Added lib/social/src/parse/nature.rs lib/social/src/parse/nature.rs +34 −0 View lib/social/src/parse/nature.rs
@@ -0,0 +1,34 @@
1//! Nature — 知识 — nature.com
2//!
3//! nature
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Nature — 知识 — nature.com
10pub struct Nature;
11
12impl Platform for Nature {
13 fn id(&self) -> &'static str {
14 "nature"
15 }
16
17 fn name(&self) -> &'static str {
18 "Nature"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nature.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nature = Nature;
Added lib/social/src/parse/neogaf.rs lib/social/src/parse/neogaf.rs +34 −0 View lib/social/src/parse/neogaf.rs
@@ -0,0 +1,34 @@
1//! NeoGAF — 论坛 — neogaf.com
2//!
3//! neogaf
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// NeoGAF — 论坛 — neogaf.com
10pub struct Neogaf;
11
12impl Platform for Neogaf {
13 fn id(&self) -> &'static str {
14 "neogaf"
15 }
16
17 fn name(&self) -> &'static str {
18 "NeoGAF"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["neogaf.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Neogaf = Neogaf;
Added lib/social/src/parse/netease_cc.rs lib/social/src/parse/netease_cc.rs +34 −0 View lib/social/src/parse/netease_cc.rs
@@ -0,0 +1,34 @@
1//! 网易CC直播 — 直播 — cc.163.com
2//!
3//! netease-cc
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 网易CC直播 — 直播 — cc.163.com
10pub struct NeteaseCc;
11
12impl Platform for NeteaseCc {
13 fn id(&self) -> &'static str {
14 "netease-cc"
15 }
16
17 fn name(&self) -> &'static str {
18 "网易CC直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["cc.163.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: NeteaseCc = NeteaseCc;
Added lib/social/src/parse/netease_music.rs lib/social/src/parse/netease_music.rs +33 −0 View lib/social/src/parse/netease_music.rs
@@ -0,0 +1,33 @@
1//! 网易云音乐 — 音乐 — music.163.com, 163cn.tv, y.163.com
2//!
3//! netease-music
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// 网易云音乐 — 音乐 — music.163.com, 163cn.tv, y.163.com
9pub struct NeteaseMusic;
10
11impl Platform for NeteaseMusic {
12 fn id(&self) -> &'static str {
13 "netease-music"
14 }
15
16 fn name(&self) -> &'static str {
17 "网易云音乐"
18 }
19
20 fn category(&self) -> Category {
21 Category::Music
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["music.163.com", "163cn.tv", "y.163.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide(r"song\?id=(\d+)", "https://music.163.com/outchain/player?type=2&id={id}&auto=0&height=66"))
30 }
31}
32
33pub static PLATFORM: NeteaseMusic = NeteaseMusic;
Added lib/social/src/parse/netease_news.rs lib/social/src/parse/netease_news.rs +34 −0 View lib/social/src/parse/netease_news.rs
@@ -0,0 +1,34 @@
1//! 网易新闻 — 新闻 — news.163.com, 163.com
2//!
3//! netease-news
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 网易新闻 — 新闻 — news.163.com, 163.com
10pub struct NeteaseNews;
11
12impl Platform for NeteaseNews {
13 fn id(&self) -> &'static str {
14 "netease-news"
15 }
16
17 fn name(&self) -> &'static str {
18 "网易新闻"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["news.163.com", "163.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: NeteaseNews = NeteaseNews;
Added lib/social/src/parse/netflix.rs lib/social/src/parse/netflix.rs +34 −0 View lib/social/src/parse/netflix.rs
@@ -0,0 +1,34 @@
1//! Netflix — 视频 — netflix.com
2//!
3//! netflix
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Netflix — 视频 — netflix.com
10pub struct Netflix;
11
12impl Platform for Netflix {
13 fn id(&self) -> &'static str {
14 "netflix"
15 }
16
17 fn name(&self) -> &'static str {
18 "Netflix"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["netflix.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Netflix = Netflix;
Added lib/social/src/parse/netlify.rs lib/social/src/parse/netlify.rs +34 −0 View lib/social/src/parse/netlify.rs
@@ -0,0 +1,34 @@
1//! Netlify — 开发 — netlify.app, netlify.com
2//!
3//! netlify
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Netlify — 开发 — netlify.app, netlify.com
10pub struct Netlify;
11
12impl Platform for Netlify {
13 fn id(&self) -> &'static str {
14 "netlify"
15 }
16
17 fn name(&self) -> &'static str {
18 "Netlify"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["netlify.app", "netlify.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Netlify = Netlify;
Added lib/social/src/parse/newsmth.rs lib/social/src/parse/newsmth.rs +34 −0 View lib/social/src/parse/newsmth.rs
@@ -0,0 +1,34 @@
1//! 水木社区 — 论坛 — newsmth.net, mysmth.net
2//!
3//! newsmth
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 水木社区 — 论坛 — newsmth.net, mysmth.net
10pub struct Newsmth;
11
12impl Platform for Newsmth {
13 fn id(&self) -> &'static str {
14 "newsmth"
15 }
16
17 fn name(&self) -> &'static str {
18 "水木社区"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["newsmth.net", "mysmth.net"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Newsmth = Newsmth;
Added lib/social/src/parse/nextdoor.rs lib/social/src/parse/nextdoor.rs +34 −0 View lib/social/src/parse/nextdoor.rs
@@ -0,0 +1,34 @@
1//! Nextdoor — 社交 — nextdoor.com
2//!
3//! nextdoor
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Nextdoor — 社交 — nextdoor.com
10pub struct Nextdoor;
11
12impl Platform for Nextdoor {
13 fn id(&self) -> &'static str {
14 "nextdoor"
15 }
16
17 fn name(&self) -> &'static str {
18 "Nextdoor"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nextdoor.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nextdoor = Nextdoor;
Added lib/social/src/parse/nextjs.rs lib/social/src/parse/nextjs.rs +34 −0 View lib/social/src/parse/nextjs.rs
@@ -0,0 +1,34 @@
1//! Next.js — 开发 — nextjs.org
2//!
3//! nextjs
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Next.js — 开发 — nextjs.org
10pub struct Nextjs;
11
12impl Platform for Nextjs {
13 fn id(&self) -> &'static str {
14 "nextjs"
15 }
16
17 fn name(&self) -> &'static str {
18 "Next.js"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nextjs.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nextjs = Nextjs;
Added lib/social/src/parse/nga.rs lib/social/src/parse/nga.rs +34 −0 View lib/social/src/parse/nga.rs
@@ -0,0 +1,34 @@
1//! NGA — 论坛 — nga.cn, ngacn.cc
2//!
3//! nga
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// NGA — 论坛 — nga.cn, ngacn.cc
10pub struct Nga;
11
12impl Platform for Nga {
13 fn id(&self) -> &'static str {
14 "nga"
15 }
16
17 fn name(&self) -> &'static str {
18 "NGA"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nga.cn", "ngacn.cc"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nga = Nga;
Added lib/social/src/parse/nicovideo.rs lib/social/src/parse/nicovideo.rs +33 −0 View lib/social/src/parse/nicovideo.rs
@@ -0,0 +1,33 @@
1//! ニコニコ — 视频 — nicovideo.jp, nico.ms
2//!
3//! nicovideo
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// ニコニコ — 视频 — nicovideo.jp, nico.ms
9pub struct Nicovideo;
10
11impl Platform for Nicovideo {
12 fn id(&self) -> &'static str {
13 "nicovideo"
14 }
15
16 fn name(&self) -> &'static str {
17 "ニコニコ"
18 }
19
20 fn category(&self) -> Category {
21 Category::Video
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["nicovideo.jp", "nico.ms"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide(r"^/watch/(sm\d+)", "https://embed.nicovideo.jp/watch/{id}"))
30 }
31}
32
33pub static PLATFORM: Nicovideo = Nicovideo;
Added lib/social/src/parse/nike.rs lib/social/src/parse/nike.rs +34 −0 View lib/social/src/parse/nike.rs
@@ -0,0 +1,34 @@
1//! Nike — 电商 — nike.com
2//!
3//! nike
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Nike — 电商 — nike.com
10pub struct Nike;
11
12impl Platform for Nike {
13 fn id(&self) -> &'static str {
14 "nike"
15 }
16
17 fn name(&self) -> &'static str {
18 "Nike"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nike.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nike = Nike;
Added lib/social/src/parse/nimotv.rs lib/social/src/parse/nimotv.rs +34 −0 View lib/social/src/parse/nimotv.rs
@@ -0,0 +1,34 @@
1//! Nimo TV — 直播 — nimotv.com
2//!
3//! nimotv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Nimo TV — 直播 — nimotv.com
10pub struct Nimotv;
11
12impl Platform for Nimotv {
13 fn id(&self) -> &'static str {
14 "nimotv"
15 }
16
17 fn name(&self) -> &'static str {
18 "Nimo TV"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nimotv.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nimotv = Nimotv;
Added lib/social/src/parse/nodejs.rs lib/social/src/parse/nodejs.rs +34 −0 View lib/social/src/parse/nodejs.rs
@@ -0,0 +1,34 @@
1//! Node.js — 开发 — nodejs.org
2//!
3//! nodejs
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Node.js — 开发 — nodejs.org
10pub struct Nodejs;
11
12impl Platform for Nodejs {
13 fn id(&self) -> &'static str {
14 "nodejs"
15 }
16
17 fn name(&self) -> &'static str {
18 "Node.js"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nodejs.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nodejs = Nodejs;
Added lib/social/src/parse/notion.rs lib/social/src/parse/notion.rs +34 −0 View lib/social/src/parse/notion.rs
@@ -0,0 +1,34 @@
1//! Notion — 知识 — notion.so, notion.site
2//!
3//! notion
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Notion — 知识 — notion.so, notion.site
10pub struct Notion;
11
12impl Platform for Notion {
13 fn id(&self) -> &'static str {
14 "notion"
15 }
16
17 fn name(&self) -> &'static str {
18 "Notion"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["notion.so", "notion.site"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Notion = Notion;
Added lib/social/src/parse/npm.rs lib/social/src/parse/npm.rs +34 −0 View lib/social/src/parse/npm.rs
@@ -0,0 +1,34 @@
1//! npm — 开发 — npmjs.com, npmjs.org
2//!
3//! npm
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// npm — 开发 — npmjs.com, npmjs.org
10pub struct Npm;
11
12impl Platform for Npm {
13 fn id(&self) -> &'static str {
14 "npm"
15 }
16
17 fn name(&self) -> &'static str {
18 "npm"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["npmjs.com", "npmjs.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Npm = Npm;
Added lib/social/src/parse/nuxt.rs lib/social/src/parse/nuxt.rs +34 −0 View lib/social/src/parse/nuxt.rs
@@ -0,0 +1,34 @@
1//! Nuxt — 开发 — nuxt.com
2//!
3//! nuxt
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Nuxt — 开发 — nuxt.com
10pub struct Nuxt;
11
12impl Platform for Nuxt {
13 fn id(&self) -> &'static str {
14 "nuxt"
15 }
16
17 fn name(&self) -> &'static str {
18 "Nuxt"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nuxt.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Nuxt = Nuxt;
Added lib/social/src/parse/nytimes.rs lib/social/src/parse/nytimes.rs +39 −0 View lib/social/src/parse/nytimes.rs
@@ -0,0 +1,39 @@
1//! The New York Times — 新闻 — nytimes.com, nyti.ms
2//!
3//! nytimes
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// The New York Times — 新闻 — nytimes.com, nyti.ms
10pub struct Nytimes;
11
12impl Platform for Nytimes {
13 fn id(&self) -> &'static str {
14 "nytimes"
15 }
16
17 fn name(&self) -> &'static str {
18 "The New York Times"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["nytimes.com", "nyti.ms"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32 /// oEmbed 接口,聊天侧联网补全标题 / 简介 / 封面(iframe 仅在平台自有域名下采用)。
33 fn oembed(&self) -> Option<&'static str> {
34 Some("https://www.nytimes.com/svc/oembed/json/?url={url_enc}")
35 }
36
37}
38
39pub static PLATFORM: Nytimes = Nytimes;
Added lib/social/src/parse/obsidian.rs lib/social/src/parse/obsidian.rs +34 −0 View lib/social/src/parse/obsidian.rs
@@ -0,0 +1,34 @@
1//! Obsidian Publish — 知识 — obsidian.md, obsidianpublish.com
2//!
3//! obsidian
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Obsidian Publish — 知识 — obsidian.md, obsidianpublish.com
10pub struct Obsidian;
11
12impl Platform for Obsidian {
13 fn id(&self) -> &'static str {
14 "obsidian"
15 }
16
17 fn name(&self) -> &'static str {
18 "Obsidian Publish"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["obsidian.md", "obsidianpublish.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Obsidian = Obsidian;
Added lib/social/src/parse/odysee.rs lib/social/src/parse/odysee.rs +37 −0 View lib/social/src/parse/odysee.rs
@@ -0,0 +1,37 @@
1//! Odysee — 视频 — odysee.com
2//!
3//! odysee
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Odysee — 视频 — odysee.com
10pub struct Odysee;
11
12impl Platform for Odysee {
13 fn id(&self) -> &'static str {
14 "odysee"
15 }
16
17 fn name(&self) -> &'static str {
18 "Odysee"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["odysee.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32 fn oembed(&self) -> Option<&'static str> {
33 Some("https://odysee.com/$/oembed?url={url_enc}&format=json")
34 }
35}
36
37pub static PLATFORM: Odysee = Odysee;
Added lib/social/src/parse/openai.rs lib/social/src/parse/openai.rs +34 −0 View lib/social/src/parse/openai.rs
@@ -0,0 +1,34 @@
1//! OpenAI — 开发 — openai.com, chatgpt.com
2//!
3//! openai
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// OpenAI — 开发 — openai.com, chatgpt.com
10pub struct Openai;
11
12impl Platform for Openai {
13 fn id(&self) -> &'static str {
14 "openai"
15 }
16
17 fn name(&self) -> &'static str {
18 "OpenAI"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["openai.com", "chatgpt.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Openai = Openai;
Added lib/social/src/parse/oschina.rs lib/social/src/parse/oschina.rs +34 −0 View lib/social/src/parse/oschina.rs
@@ -0,0 +1,34 @@
1//! 开源中国 — 开发 — oschina.net
2//!
3//! oschina
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 开源中国 — 开发 — oschina.net
10pub struct Oschina;
11
12impl Platform for Oschina {
13 fn id(&self) -> &'static str {
14 "oschina"
15 }
16
17 fn name(&self) -> &'static str {
18 "开源中国"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["oschina.net"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Oschina = Oschina;
Added lib/social/src/parse/p1688.rs lib/social/src/parse/p1688.rs +34 −0 View lib/social/src/parse/p1688.rs
@@ -0,0 +1,34 @@
1//! 1688 — 电商 — 1688.com, alibaba.com, alibaba.cn
2//!
3//! 1688
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 1688 — 电商 — 1688.com, alibaba.com, alibaba.cn
10pub struct P1688;
11
12impl Platform for P1688 {
13 fn id(&self) -> &'static str {
14 "1688"
15 }
16
17 fn name(&self) -> &'static str {
18 "1688"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["1688.com", "alibaba.com", "alibaba.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P1688 = P1688;
Added lib/social/src/parse/p17live.rs lib/social/src/parse/p17live.rs +34 −0 View lib/social/src/parse/p17live.rs
@@ -0,0 +1,34 @@
1//! 17LIVE — 直播 — 17.live, 17app.co
2//!
3//! 17live
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 17LIVE — 直播 — 17.live, 17app.co
10pub struct P17live;
11
12impl Platform for P17live {
13 fn id(&self) -> &'static str {
14 "17live"
15 }
16
17 fn name(&self) -> &'static str {
18 "17LIVE"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["17.live", "17app.co"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P17live = P17live;
Added lib/social/src/parse/p36kr.rs lib/social/src/parse/p36kr.rs +34 −0 View lib/social/src/parse/p36kr.rs
@@ -0,0 +1,34 @@
1//! 36氪 — 新闻 — 36kr.com
2//!
3//! 36kr
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 36氪 — 新闻 — 36kr.com
10pub struct P36kr;
11
12impl Platform for P36kr {
13 fn id(&self) -> &'static str {
14 "36kr"
15 }
16
17 fn name(&self) -> &'static str {
18 "36氪"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["36kr.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P36kr = P36kr;
Added lib/social/src/parse/p4chan.rs lib/social/src/parse/p4chan.rs +34 −0 View lib/social/src/parse/p4chan.rs
@@ -0,0 +1,34 @@
1//! 4chan — 论坛 — 4chan.org, 4channel.org
2//!
3//! 4chan
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 4chan — 论坛 — 4chan.org, 4channel.org
10pub struct P4chan;
11
12impl Platform for P4chan {
13 fn id(&self) -> &'static str {
14 "4chan"
15 }
16
17 fn name(&self) -> &'static str {
18 "4chan"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["4chan.org", "4channel.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P4chan = P4chan;
Added lib/social/src/parse/p52pojie.rs lib/social/src/parse/p52pojie.rs +34 −0 View lib/social/src/parse/p52pojie.rs
@@ -0,0 +1,34 @@
1//! 吾爱破解 — 论坛 — 52pojie.cn
2//!
3//! 52pojie
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 吾爱破解 — 论坛 — 52pojie.cn
10pub struct P52pojie;
11
12impl Platform for P52pojie {
13 fn id(&self) -> &'static str {
14 "52pojie"
15 }
16
17 fn name(&self) -> &'static str {
18 "吾爱破解"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["52pojie.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P52pojie = P52pojie;
Added lib/social/src/parse/p56.rs lib/social/src/parse/p56.rs +34 −0 View lib/social/src/parse/p56.rs
@@ -0,0 +1,34 @@
1//! 56视频 — 视频 — 56.com
2//!
3//! 56
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 56视频 — 视频 — 56.com
10pub struct P56;
11
12impl Platform for P56 {
13 fn id(&self) -> &'static str {
14 "56"
15 }
16
17 fn name(&self) -> &'static str {
18 "56视频"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["56.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P56 = P56;
Added lib/social/src/parse/p58.rs lib/social/src/parse/p58.rs +34 −0 View lib/social/src/parse/p58.rs
@@ -0,0 +1,34 @@
1//! 58同城 — 电商 — 58.com
2//!
3//! 58
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 58同城 — 电商 — 58.com
10pub struct P58;
11
12impl Platform for P58 {
13 fn id(&self) -> &'static str {
14 "58"
15 }
16
17 fn name(&self) -> &'static str {
18 "58同城"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["58.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P58 = P58;
Added lib/social/src/parse/p5sing.rs lib/social/src/parse/p5sing.rs +34 −0 View lib/social/src/parse/p5sing.rs
@@ -0,0 +1,34 @@
1//! 5sing — 音乐 — 5sing.kugou.com, 5sing.com
2//!
3//! 5sing
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 5sing — 音乐 — 5sing.kugou.com, 5sing.com
10pub struct P5sing;
11
12impl Platform for P5sing {
13 fn id(&self) -> &'static str {
14 "5sing"
15 }
16
17 fn name(&self) -> &'static str {
18 "5sing"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["5sing.kugou.com", "5sing.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P5sing = P5sing;
Added lib/social/src/parse/p6rooms.rs lib/social/src/parse/p6rooms.rs +34 −0 View lib/social/src/parse/p6rooms.rs
@@ -0,0 +1,34 @@
1//! 六间房 — 视频 — 6.cn, 6rooms.com
2//!
3//! 6rooms
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 六间房 — 视频 — 6.cn, 6rooms.com
10pub struct P6rooms;
11
12impl Platform for P6rooms {
13 fn id(&self) -> &'static str {
14 "6rooms"
15 }
16
17 fn name(&self) -> &'static str {
18 "六间房"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["6.cn", "6rooms.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: P6rooms = P6rooms;
Added lib/social/src/parse/panda.rs lib/social/src/parse/panda.rs +34 −0 View lib/social/src/parse/panda.rs
@@ -0,0 +1,34 @@
1//! 熊猫直播 — 直播 — panda.tv
2//!
3//! panda
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 熊猫直播 — 直播 — panda.tv
10pub struct Panda;
11
12impl Platform for Panda {
13 fn id(&self) -> &'static str {
14 "panda"
15 }
16
17 fn name(&self) -> &'static str {
18 "熊猫直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["panda.tv"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Panda = Panda;
Added lib/social/src/parse/pandora.rs lib/social/src/parse/pandora.rs +34 −0 View lib/social/src/parse/pandora.rs
@@ -0,0 +1,34 @@
1//! Pandora — 音乐 — pandora.com
2//!
3//! pandora
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Pandora — 音乐 — pandora.com
10pub struct Pandora;
11
12impl Platform for Pandora {
13 fn id(&self) -> &'static str {
14 "pandora"
15 }
16
17 fn name(&self) -> &'static str {
18 "Pandora"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pandora.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pandora = Pandora;
Added lib/social/src/parse/paramount.rs lib/social/src/parse/paramount.rs +34 −0 View lib/social/src/parse/paramount.rs
@@ -0,0 +1,34 @@
1//! Paramount+ — 视频 — paramountplus.com
2//!
3//! paramount
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Paramount+ — 视频 — paramountplus.com
10pub struct Paramount;
11
12impl Platform for Paramount {
13 fn id(&self) -> &'static str {
14 "paramount"
15 }
16
17 fn name(&self) -> &'static str {
18 "Paramount+"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["paramountplus.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Paramount = Paramount;
Added lib/social/src/parse/peacock.rs lib/social/src/parse/peacock.rs +34 −0 View lib/social/src/parse/peacock.rs
@@ -0,0 +1,34 @@
1//! Peacock — 视频 — peacocktv.com
2//!
3//! peacock
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Peacock — 视频 — peacocktv.com
10pub struct Peacock;
11
12impl Platform for Peacock {
13 fn id(&self) -> &'static str {
14 "peacock"
15 }
16
17 fn name(&self) -> &'static str {
18 "Peacock"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["peacocktv.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Peacock = Peacock;
Added lib/social/src/parse/people.rs lib/social/src/parse/people.rs +34 −0 View lib/social/src/parse/people.rs
@@ -0,0 +1,34 @@
1//! 人民网 — 新闻 — people.com.cn, people.cn
2//!
3//! people
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 人民网 — 新闻 — people.com.cn, people.cn
10pub struct People;
11
12impl Platform for People {
13 fn id(&self) -> &'static str {
14 "people"
15 }
16
17 fn name(&self) -> &'static str {
18 "人民网"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["people.com.cn", "people.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: People = People;
Added lib/social/src/parse/pexels.rs lib/social/src/parse/pexels.rs +34 −0 View lib/social/src/parse/pexels.rs
@@ -0,0 +1,34 @@
1//! Pexels — 开发 — pexels.com
2//!
3//! pexels
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Pexels — 开发 — pexels.com
10pub struct Pexels;
11
12impl Platform for Pexels {
13 fn id(&self) -> &'static str {
14 "pexels"
15 }
16
17 fn name(&self) -> &'static str {
18 "Pexels"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pexels.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pexels = Pexels;
Added lib/social/src/parse/phpbb.rs lib/social/src/parse/phpbb.rs +34 −0 View lib/social/src/parse/phpbb.rs
@@ -0,0 +1,34 @@
1//! phpBB — 论坛 — phpbb.com
2//!
3//! phpbb
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// phpBB — 论坛 — phpbb.com
10pub struct Phpbb;
11
12impl Platform for Phpbb {
13 fn id(&self) -> &'static str {
14 "phpbb"
15 }
16
17 fn name(&self) -> &'static str {
18 "phpBB"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["phpbb.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Phpbb = Phpbb;
Added lib/social/src/parse/pinduoduo.rs lib/social/src/parse/pinduoduo.rs +34 −0 View lib/social/src/parse/pinduoduo.rs
@@ -0,0 +1,34 @@
1//! 拼多多 — 电商 — pinduoduo.com, yangkeduo.com, pdd.cn
2//!
3//! pinduoduo
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 拼多多 — 电商 — pinduoduo.com, yangkeduo.com, pdd.cn
10pub struct Pinduoduo;
11
12impl Platform for Pinduoduo {
13 fn id(&self) -> &'static str {
14 "pinduoduo"
15 }
16
17 fn name(&self) -> &'static str {
18 "拼多多"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pinduoduo.com", "yangkeduo.com", "pdd.cn"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pinduoduo = Pinduoduo;
Added lib/social/src/parse/pinterest.rs lib/social/src/parse/pinterest.rs +38 −0 View lib/social/src/parse/pinterest.rs
@@ -0,0 +1,38 @@
1//! Pinterest — 社交 — pinterest.com, pinterest.co.uk, pinterest.de, pin.it
2//!
3//! pinterest
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Pinterest — 社交 — pinterest.com, pinterest.co.uk, pinterest.de, pin.it
9pub struct Pinterest;
10
11impl Platform for Pinterest {
12 fn id(&self) -> &'static str {
13 "pinterest"
14 }
15
16 fn name(&self) -> &'static str {
17 "Pinterest"
18 }
19
20 fn category(&self) -> Category {
21 Category::Social
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["pinterest.com", "pinterest.co.uk", "pinterest.de", "pin.it"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide(r"^/pin/(\d+)", "https://assets.pinterest.com/ext/embed.html?id={id}"))
30 }
31 /// oEmbed 接口,聊天侧联网补全标题 / 简介 / 封面(iframe 仅在平台自有域名下采用)。
32 fn oembed(&self) -> Option<&'static str> {
33 Some("https://www.pinterest.com/oembed.json?url={url_enc}")
34 }
35
36}
37
38pub static PLATFORM: Pinterest = Pinterest;
Added lib/social/src/parse/pipixia.rs lib/social/src/parse/pipixia.rs +34 −0 View lib/social/src/parse/pipixia.rs
@@ -0,0 +1,34 @@
1//! 皮皮虾 — 社交 — pipix.com
2//!
3//! pipixia
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 皮皮虾 — 社交 — pipix.com
10pub struct Pipixia;
11
12impl Platform for Pipixia {
13 fn id(&self) -> &'static str {
14 "pipixia"
15 }
16
17 fn name(&self) -> &'static str {
18 "皮皮虾"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pipix.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pipixia = Pipixia;
Added lib/social/src/parse/pixabay.rs lib/social/src/parse/pixabay.rs +34 −0 View lib/social/src/parse/pixabay.rs
@@ -0,0 +1,34 @@
1//! Pixabay — 开发 — pixabay.com
2//!
3//! pixabay
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Pixabay — 开发 — pixabay.com
10pub struct Pixabay;
11
12impl Platform for Pixabay {
13 fn id(&self) -> &'static str {
14 "pixabay"
15 }
16
17 fn name(&self) -> &'static str {
18 "Pixabay"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pixabay.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pixabay = Pixabay;
Added lib/social/src/parse/pixiv.rs lib/social/src/parse/pixiv.rs +33 −0 View lib/social/src/parse/pixiv.rs
@@ -0,0 +1,33 @@
1//! Pixiv — 社交 — pixiv.net, pixiv.me
2//!
3//! pixiv
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Pixiv — 社交 — pixiv.net, pixiv.me
9pub struct Pixiv;
10
11impl Platform for Pixiv {
12 fn id(&self) -> &'static str {
13 "pixiv"
14 }
15
16 fn name(&self) -> &'static str {
17 "Pixiv"
18 }
19
20 fn category(&self) -> Category {
21 Category::Social
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["pixiv.net", "pixiv.me"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::square(r"^/artworks/(\d+)", "https://embed.pixiv.net/decorate.php?illust_id={id}"))
30 }
31}
32
33pub static PLATFORM: Pixiv = Pixiv;
Added lib/social/src/parse/plurk.rs lib/social/src/parse/plurk.rs +34 −0 View lib/social/src/parse/plurk.rs
@@ -0,0 +1,34 @@
1//! Plurk — 社交 — plurk.com
2//!
3//! plurk
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Plurk — 社交 — plurk.com
10pub struct Plurk;
11
12impl Platform for Plurk {
13 fn id(&self) -> &'static str {
14 "plurk"
15 }
16
17 fn name(&self) -> &'static str {
18 "Plurk"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["plurk.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Plurk = Plurk;
Added lib/social/src/parse/podbean.rs lib/social/src/parse/podbean.rs +39 −0 View lib/social/src/parse/podbean.rs
@@ -0,0 +1,39 @@
1//! Podbean — 音乐 — podbean.com
2//!
3//! podbean
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Podbean — 音乐 — podbean.com
10pub struct Podbean;
11
12impl Platform for Podbean {
13 fn id(&self) -> &'static str {
14 "podbean"
15 }
16
17 fn name(&self) -> &'static str {
18 "Podbean"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["podbean.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32 /// oEmbed 接口,聊天侧联网补全标题 / 简介 / 封面(iframe 仅在平台自有域名下采用)。
33 fn oembed(&self) -> Option<&'static str> {
34 Some("https://api.podbean.com/v1/oembed?url={url_enc}")
35 }
36
37}
38
39pub static PLATFORM: Podbean = Podbean;
Added lib/social/src/parse/postgresql.rs lib/social/src/parse/postgresql.rs +34 −0 View lib/social/src/parse/postgresql.rs
@@ -0,0 +1,34 @@
1//! PostgreSQL — 开发 — postgresql.org
2//!
3//! postgresql
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// PostgreSQL — 开发 — postgresql.org
10pub struct Postgresql;
11
12impl Platform for Postgresql {
13 fn id(&self) -> &'static str {
14 "postgresql"
15 }
16
17 fn name(&self) -> &'static str {
18 "PostgreSQL"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["postgresql.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Postgresql = Postgresql;
Added lib/social/src/parse/postman.rs lib/social/src/parse/postman.rs +34 −0 View lib/social/src/parse/postman.rs
@@ -0,0 +1,34 @@
1//! Postman — 开发 — postman.com, getpostman.com
2//!
3//! postman
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Postman — 开发 — postman.com, getpostman.com
10pub struct Postman;
11
12impl Platform for Postman {
13 fn id(&self) -> &'static str {
14 "postman"
15 }
16
17 fn name(&self) -> &'static str {
18 "Postman"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["postman.com", "getpostman.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Postman = Postman;
Added lib/social/src/parse/pptv.rs lib/social/src/parse/pptv.rs +34 −0 View lib/social/src/parse/pptv.rs
@@ -0,0 +1,34 @@
1//! PPTV — 视频 — pptv.com, pplive.com
2//!
3//! pptv
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// PPTV — 视频 — pptv.com, pplive.com
10pub struct Pptv;
11
12impl Platform for Pptv {
13 fn id(&self) -> &'static str {
14 "pptv"
15 }
16
17 fn name(&self) -> &'static str {
18 "PPTV"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pptv.com", "pplive.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pptv = Pptv;
Added lib/social/src/parse/primevideo.rs lib/social/src/parse/primevideo.rs +34 −0 View lib/social/src/parse/primevideo.rs
@@ -0,0 +1,34 @@
1//! Prime Video — 视频 — primevideo.com
2//!
3//! primevideo
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Prime Video — 视频 — primevideo.com
10pub struct Primevideo;
11
12impl Platform for Primevideo {
13 fn id(&self) -> &'static str {
14 "primevideo"
15 }
16
17 fn name(&self) -> &'static str {
18 "Prime Video"
19 }
20
21 fn category(&self) -> Category {
22 Category::Video
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["primevideo.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Primevideo = Primevideo;
Added lib/social/src/parse/producthunt.rs lib/social/src/parse/producthunt.rs +34 −0 View lib/social/src/parse/producthunt.rs
@@ -0,0 +1,34 @@
1//! Product Hunt — 开发 — producthunt.com
2//!
3//! producthunt
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Product Hunt — 开发 — producthunt.com
10pub struct Producthunt;
11
12impl Platform for Producthunt {
13 fn id(&self) -> &'static str {
14 "producthunt"
15 }
16
17 fn name(&self) -> &'static str {
18 "Product Hunt"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["producthunt.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Producthunt = Producthunt;
Added lib/social/src/parse/pubmed.rs lib/social/src/parse/pubmed.rs +34 −0 View lib/social/src/parse/pubmed.rs
@@ -0,0 +1,34 @@
1//! PubMed — 知识 — pubmed.ncbi.nlm.nih.gov, ncbi.nlm.nih.gov
2//!
3//! pubmed
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// PubMed — 知识 — pubmed.ncbi.nlm.nih.gov, ncbi.nlm.nih.gov
10pub struct Pubmed;
11
12impl Platform for Pubmed {
13 fn id(&self) -> &'static str {
14 "pubmed"
15 }
16
17 fn name(&self) -> &'static str {
18 "PubMed"
19 }
20
21 fn category(&self) -> Category {
22 Category::Knowledge
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pubmed.ncbi.nlm.nih.gov", "ncbi.nlm.nih.gov"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pubmed = Pubmed;
Added lib/social/src/parse/pypi.rs lib/social/src/parse/pypi.rs +34 −0 View lib/social/src/parse/pypi.rs
@@ -0,0 +1,34 @@
1//! PyPI — 开发 — pypi.org
2//!
3//! pypi
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// PyPI — 开发 — pypi.org
10pub struct Pypi;
11
12impl Platform for Pypi {
13 fn id(&self) -> &'static str {
14 "pypi"
15 }
16
17 fn name(&self) -> &'static str {
18 "PyPI"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["pypi.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Pypi = Pypi;
Added lib/social/src/parse/python.rs lib/social/src/parse/python.rs +34 −0 View lib/social/src/parse/python.rs
@@ -0,0 +1,34 @@
1//! Python — 开发 — python.org
2//!
3//! python
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Python — 开发 — python.org
10pub struct Python;
11
12impl Platform for Python {
13 fn id(&self) -> &'static str {
14 "python"
15 }
16
17 fn name(&self) -> &'static str {
18 "Python"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["python.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Python = Python;
Added lib/social/src/parse/qianqian.rs lib/social/src/parse/qianqian.rs +34 −0 View lib/social/src/parse/qianqian.rs
@@ -0,0 +1,34 @@
1//! 千千音乐 — 音乐 — music.taihe.com, qianqian.com
2//!
3//! qianqian
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 千千音乐 — 音乐 — music.taihe.com, qianqian.com
10pub struct Qianqian;
11
12impl Platform for Qianqian {
13 fn id(&self) -> &'static str {
14 "qianqian"
15 }
16
17 fn name(&self) -> &'static str {
18 "千千音乐"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["music.taihe.com", "qianqian.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qianqian = Qianqian;
Added lib/social/src/parse/qie.rs lib/social/src/parse/qie.rs +34 −0 View lib/social/src/parse/qie.rs
@@ -0,0 +1,34 @@
1//! 企鹅直播 — 直播 — live.qq.com
2//!
3//! qie
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 企鹅直播 — 直播 — live.qq.com
10pub struct Qie;
11
12impl Platform for Qie {
13 fn id(&self) -> &'static str {
14 "qie"
15 }
16
17 fn name(&self) -> &'static str {
18 "企鹅直播"
19 }
20
21 fn category(&self) -> Category {
22 Category::Live
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["live.qq.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qie = Qie;
Added lib/social/src/parse/qingting.rs lib/social/src/parse/qingting.rs +34 −0 View lib/social/src/parse/qingting.rs
@@ -0,0 +1,34 @@
1//! 蜻蜓FM — 音乐 — qingting.fm
2//!
3//! qingting
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 蜻蜓FM — 音乐 — qingting.fm
10pub struct Qingting;
11
12impl Platform for Qingting {
13 fn id(&self) -> &'static str {
14 "qingting"
15 }
16
17 fn name(&self) -> &'static str {
18 "蜻蜓FM"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["qingting.fm"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qingting = Qingting;
Added lib/social/src/parse/qobuz.rs lib/social/src/parse/qobuz.rs +34 −0 View lib/social/src/parse/qobuz.rs
@@ -0,0 +1,34 @@
1//! Qobuz — 音乐 — qobuz.com
2//!
3//! qobuz
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Qobuz — 音乐 — qobuz.com
10pub struct Qobuz;
11
12impl Platform for Qobuz {
13 fn id(&self) -> &'static str {
14 "qobuz"
15 }
16
17 fn name(&self) -> &'static str {
18 "Qobuz"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["qobuz.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qobuz = Qobuz;
Added lib/social/src/parse/qq.rs lib/social/src/parse/qq.rs +34 −0 View lib/social/src/parse/qq.rs
@@ -0,0 +1,34 @@
1//! QQ — 社交 — qq.com, im.qq.com
2//!
3//! qq
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// QQ — 社交 — qq.com, im.qq.com
10pub struct Qq;
11
12impl Platform for Qq {
13 fn id(&self) -> &'static str {
14 "qq"
15 }
16
17 fn name(&self) -> &'static str {
18 "QQ"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["qq.com", "im.qq.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qq = Qq;
Added lib/social/src/parse/qq_news.rs lib/social/src/parse/qq_news.rs +34 −0 View lib/social/src/parse/qq_news.rs
@@ -0,0 +1,34 @@
1//! 腾讯新闻 — 新闻 — news.qq.com
2//!
3//! qq-news
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 腾讯新闻 — 新闻 — news.qq.com
10pub struct QqNews;
11
12impl Platform for QqNews {
13 fn id(&self) -> &'static str {
14 "qq-news"
15 }
16
17 fn name(&self) -> &'static str {
18 "腾讯新闻"
19 }
20
21 fn category(&self) -> Category {
22 Category::News
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["news.qq.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: QqNews = QqNews;
Added lib/social/src/parse/qqmusic.rs lib/social/src/parse/qqmusic.rs +34 −0 View lib/social/src/parse/qqmusic.rs
@@ -0,0 +1,34 @@
1//! QQ音乐 — 音乐 — y.qq.com, c.y.qq.com, i.y.qq.com
2//!
3//! qqmusic
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// QQ音乐 — 音乐 — y.qq.com, c.y.qq.com, i.y.qq.com
10pub struct Qqmusic;
11
12impl Platform for Qqmusic {
13 fn id(&self) -> &'static str {
14 "qqmusic"
15 }
16
17 fn name(&self) -> &'static str {
18 "QQ音乐"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["y.qq.com", "c.y.qq.com", "i.y.qq.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qqmusic = Qqmusic;
Added lib/social/src/parse/qqvideo.rs lib/social/src/parse/qqvideo.rs +33 −0 View lib/social/src/parse/qqvideo.rs
@@ -0,0 +1,33 @@
1//! 腾讯视频 — 视频 — v.qq.com, film.qq.com
2//!
3//! qqvideo
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// 腾讯视频 — 视频 — v.qq.com, film.qq.com
9pub struct Qqvideo;
10
11impl Platform for Qqvideo {
12 fn id(&self) -> &'static str {
13 "qqvideo"
14 }
15
16 fn name(&self) -> &'static str {
17 "腾讯视频"
18 }
19
20 fn category(&self) -> Category {
21 Category::Video
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["v.qq.com", "film.qq.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide(r"^/x/(?:page|cover/[^/]+)/([A-Za-z0-9]+)\.html", "https://v.qq.com/txp/iframe/player.html?vid={id}"))
30 }
31}
32
33pub static PLATFORM: Qqvideo = Qqvideo;
Added lib/social/src/parse/quanmin.rs lib/social/src/parse/quanmin.rs +34 −0 View lib/social/src/parse/quanmin.rs
@@ -0,0 +1,34 @@
1//! 全民K歌 — 音乐 — kg.qq.com
2//!
3//! quanmin
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 全民K歌 — 音乐 — kg.qq.com
10pub struct Quanmin;
11
12impl Platform for Quanmin {
13 fn id(&self) -> &'static str {
14 "quanmin"
15 }
16
17 fn name(&self) -> &'static str {
18 "全民K歌"
19 }
20
21 fn category(&self) -> Category {
22 Category::Music
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["kg.qq.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Quanmin = Quanmin;
Added lib/social/src/parse/qunar.rs lib/social/src/parse/qunar.rs +34 −0 View lib/social/src/parse/qunar.rs
@@ -0,0 +1,34 @@
1//! 去哪儿 — 电商 — qunar.com
2//!
3//! qunar
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 去哪儿 — 电商 — qunar.com
10pub struct Qunar;
11
12impl Platform for Qunar {
13 fn id(&self) -> &'static str {
14 "qunar"
15 }
16
17 fn name(&self) -> &'static str {
18 "去哪儿"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["qunar.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qunar = Qunar;
Added lib/social/src/parse/quora.rs lib/social/src/parse/quora.rs +34 −0 View lib/social/src/parse/quora.rs
@@ -0,0 +1,34 @@
1//! Quora — 论坛 — quora.com
2//!
3//! quora
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Quora — 论坛 — quora.com
10pub struct Quora;
11
12impl Platform for Quora {
13 fn id(&self) -> &'static str {
14 "quora"
15 }
16
17 fn name(&self) -> &'static str {
18 "Quora"
19 }
20
21 fn category(&self) -> Category {
22 Category::Forum
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["quora.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Quora = Quora;
Added lib/social/src/parse/qzone.rs lib/social/src/parse/qzone.rs +34 −0 View lib/social/src/parse/qzone.rs
@@ -0,0 +1,34 @@
1//! QQ空间 — 社交 — qzone.qq.com, user.qzone.qq.com
2//!
3//! qzone
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// QQ空间 — 社交 — qzone.qq.com, user.qzone.qq.com
10pub struct Qzone;
11
12impl Platform for Qzone {
13 fn id(&self) -> &'static str {
14 "qzone"
15 }
16
17 fn name(&self) -> &'static str {
18 "QQ空间"
19 }
20
21 fn category(&self) -> Category {
22 Category::Social
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["qzone.qq.com", "user.qzone.qq.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Qzone = Qzone;
Added lib/social/src/parse/rakuten.rs lib/social/src/parse/rakuten.rs +34 −0 View lib/social/src/parse/rakuten.rs
@@ -0,0 +1,34 @@
1//! 乐天 — 电商 — rakuten.co.jp, rakuten.com
2//!
3//! rakuten
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// 乐天 — 电商 — rakuten.co.jp, rakuten.com
10pub struct Rakuten;
11
12impl Platform for Rakuten {
13 fn id(&self) -> &'static str {
14 "rakuten"
15 }
16
17 fn name(&self) -> &'static str {
18 "乐天"
19 }
20
21 fn category(&self) -> Category {
22 Category::Ecommerce
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["rakuten.co.jp", "rakuten.com"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Rakuten = Rakuten;
Added lib/social/src/parse/react.rs lib/social/src/parse/react.rs +34 −0 View lib/social/src/parse/react.rs
@@ -0,0 +1,34 @@
1//! React — 开发 — react.dev, reactjs.org
2//!
3//! react
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// React — 开发 — react.dev, reactjs.org
10pub struct React;
11
12impl Platform for React {
13 fn id(&self) -> &'static str {
14 "react"
15 }
16
17 fn name(&self) -> &'static str {
18 "React"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["react.dev", "reactjs.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: React = React;
Added lib/social/src/parse/readthedocs.rs lib/social/src/parse/readthedocs.rs +34 −0 View lib/social/src/parse/readthedocs.rs
@@ -0,0 +1,34 @@
1//! Read the Docs — 开发 — readthedocs.io, readthedocs.org
2//!
3//! readthedocs
4//! 站点不允许内嵌,渲染成带平台标识的卡片。
5
6use crate::parse::{EmbedRule, Platform};
7use crate::Category;
8
9/// Read the Docs — 开发 — readthedocs.io, readthedocs.org
10pub struct Readthedocs;
11
12impl Platform for Readthedocs {
13 fn id(&self) -> &'static str {
14 "readthedocs"
15 }
16
17 fn name(&self) -> &'static str {
18 "Read the Docs"
19 }
20
21 fn category(&self) -> Category {
22 Category::Dev
23 }
24
25 fn domains(&self) -> &'static [&'static str] {
26 &["readthedocs.io", "readthedocs.org"]
27 }
28
29 fn embed_rule(&self) -> Option<EmbedRule> {
30 None
31 }
32}
33
34pub static PLATFORM: Readthedocs = Readthedocs;
Added lib/social/src/parse/reddit.rs lib/social/src/parse/reddit.rs +38 −0 View lib/social/src/parse/reddit.rs
@@ -0,0 +1,38 @@
1//! Reddit — 论坛 — reddit.com
2//!
3//! reddit
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Reddit — 论坛 — reddit.com
9pub struct Reddit;
10
11impl Platform for Reddit {
12 fn id(&self) -> &'static str {
13 "reddit"
14 }
15
16 fn name(&self) -> &'static str {
17 "Reddit"
18 }
19
20 fn category(&self) -> Category {
21 Category::Forum
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["reddit.com"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::frame("https://www.redditmedia.com{path}?embed=true&depth=1&showmedia=true"))
30 }
31 /// oEmbed 接口,聊天侧联网补全标题 / 简介 / 封面(iframe 仅在平台自有域名下采用)。
32 fn oembed(&self) -> Option<&'static str> {
33 Some("https://www.reddit.com/oembed?url={url_enc}")
34 }
35
36}
37
38pub static PLATFORM: Reddit = Reddit;
Added lib/social/src/parse/reddit_short.rs lib/social/src/parse/reddit_short.rs +33 −0 View lib/social/src/parse/reddit_short.rs
@@ -0,0 +1,33 @@
1//! Reddit 短链 — 论坛 — redd.it
2//!
3//! reddit-short
4
5use crate::parse::{EmbedRule, Platform};
6use crate::Category;
7
8/// Reddit 短链 — 论坛 — redd.it
9pub struct RedditShort;
10
11impl Platform for RedditShort {
12 fn id(&self) -> &'static str {
13 "reddit-short"
14 }
15
16 fn name(&self) -> &'static str {
17 "Reddit 短链"
18 }
19
20 fn category(&self) -> Category {
21 Category::Forum
22 }
23
24 fn domains(&self) -> &'static [&'static str] {
25 &["redd.it"]
26 }
27
28 fn embed_rule(&self) -> Option<EmbedRule> {
29 Some(EmbedRule::wide("^/([A-Za-z0-9]+)", "https://www.redditmedia.com/comments/{id}?embed=true"))
30 }
31}
32
33pub static PLATFORM: RedditShort = RedditShort;
Added lib/social/src/lib.rs lib/social/src/lib.rs +188 −0 View lib/social/src/lib.rs
@@ -0,0 +1,188 @@
1//! URL → 平台 embed 解析。
2//!
3//! `social` 把一条消息里的链接识别成具体平台(社交、电商、视频、音乐、新闻、
4//! 论坛、直播、知识、开发工具等数百个站点),并生成可直接注入到消息流里的
5//! embed HTML:站点允许内嵌的用 `<iframe>` / `<video>` / `<audio>` / `<img>`,
6//! 不允许内嵌(`X-Frame-Options` / CSP 拦截)的退化成带平台标识的卡片。
7//!
8//! 注册表是纯静态数据([`parse::PLATFORMS`],每个平台一个文件),匹配与渲染都不做
9//! 网络请求,因此可以在消息写入路径上同步调用。
10
11pub mod parse;
12pub mod render;
13pub mod resolve;
14
15use serde::{Deserialize, Serialize};
16
17pub use parse::{EmbedRule, Platform, provider_count, providers};
18pub use render::{escape_html, render_html};
19pub use resolve::{embed, embed_json, embed_json_enriched, is_supported, oembed_endpoint, parse};
20
21/// 平台大类。
22#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, utoipa::ToSchema)]
23#[serde(rename_all = "snake_case")]
24pub enum Category {
25 /// 社交:微博、X、Facebook、小红书……
26 Social,
27 /// 电商:淘宝、京东、Amazon、Shopify……
28 Ecommerce,
29 /// 视频:B 站、YouTube、爱奇艺、Netflix……
30 Video,
31 /// 音乐/音频:网易云、Spotify、Apple Music……
32 Music,
33 /// 新闻资讯:新华网、BBC、NYTimes、36 氪……
34 News,
35 /// 论坛社区:知乎、Reddit、V2EX、NGA……
36 Forum,
37 /// 直播:斗鱼、虎牙、Twitch、Kick……
38 Live,
39 /// 知识/文档:维基百科、豆瓣读书、Notion、语雀……
40 Knowledge,
41 /// 开发工具:GitHub、GitLab、CodePen、Figma……
42 Dev,
43 /// 其它站点(含直接媒体链接兜底)。
44 Other,
45}
46
47impl Category {
48 pub const fn as_str(self) -> &'static str {
49 match self {
50 Self::Social => "social",
51 Self::Ecommerce => "ecommerce",
52 Self::Video => "video",
53 Self::Music => "music",
54 Self::News => "news",
55 Self::Forum => "forum",
56 Self::Live => "live",
57 Self::Knowledge => "knowledge",
58 Self::Dev => "dev",
59 Self::Other => "other",
60 }
61 }
62}
63
64/// embed 的呈现形态,前端据此决定容器样式。
65#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, utoipa::ToSchema)]
66#[serde(rename_all = "snake_case")]
67pub enum EmbedKind {
68 /// 第三方播放器/内容页 iframe。
69 Iframe,
70 /// 直接视频文件,渲染 `<video>`。
71 Video,
72 /// 直接音频文件,渲染 `<audio>`。
73 Audio,
74 /// 直接图片文件,渲染 `<img>`。
75 Image,
76 /// 站点禁止内嵌,渲染带平台标识的卡片。
77 Link,
78}
79
80impl EmbedKind {
81 pub const fn as_str(self) -> &'static str {
82 match self {
83 Self::Iframe => "iframe",
84 Self::Video => "video",
85 Self::Audio => "audio",
86 Self::Image => "image",
87 Self::Link => "link",
88 }
89 }
90}
91
92/// iframe / 播放器的宽高比。
93#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
94#[serde(rename_all = "snake_case")]
95pub enum Aspect {
96 /// 16:9
97 Wide,
98 /// 1:1
99 Square,
100 /// 9:16(竖屏短视频、直播)
101 Vertical,
102 /// 4:5(信息流图片)
103 Tall,
104 /// 由内容决定
105 Auto,
106}
107
108impl Aspect {
109 pub const fn css(self) -> &'static str {
110 match self {
111 Self::Wide => "16 / 9",
112 Self::Square => "1 / 1",
113 Self::Vertical => "9 / 16",
114 Self::Tall => "4 / 5",
115 Self::Auto => "auto",
116 }
117 }
118
119 pub const fn as_str(self) -> &'static str {
120 match self {
121 Self::Wide => "wide",
122 Self::Square => "square",
123 Self::Vertical => "vertical",
124 Self::Tall => "tall",
125 Self::Auto => "auto",
126 }
127 }
128}
129
130/// 解析结果:某个 URL 属于哪个平台、应该怎么嵌。
131#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
132pub struct Resolved {
133 pub platform: &'static str,
134 pub platform_name: &'static str,
135 pub category: Category,
136 pub kind: EmbedKind,
137 /// 原始 URL(规范化后)。
138 pub url: String,
139 /// iframe / 媒体源;卡片为 `None`。
140 pub src: Option<String>,
141 pub aspect: Aspect,
142 /// 展示标题(平台名,OG / oEmbed 抓取成功时由 chat 侧覆盖)。
143 pub title: String,
144 /// 简介(联网抓取成功时由 chat 侧填入)。
145 pub description: Option<String>,
146 /// 封面缩略图(oEmbed / OG 抓取成功时由 chat 侧填入)。
147 pub image_url: Option<String>,
148}
149
150/// 联网补全的信息,由 chat 侧抓取后回填。
151///
152/// 解析与渲染都不联网:抓取到的标题 / 简介 / 封面 / iframe 地址通过
153/// [`resolve::embed_json_enriched`] 合并进 embed,渲染模板仍然只由本 crate 产出。
154#[derive(Debug, Clone, Default)]
155pub struct Enrichment {
156 pub title: Option<String>,
157 pub description: Option<String>,
158 pub image_url: Option<String>,
159 /// oEmbed 返回的 iframe 地址。只有落在该平台自己声明的域名里才会被采用。
160 pub frame_src: Option<String>,
161}
162
163/// 解析 + 渲染的完整结果。
164#[derive(Debug, Clone)]
165pub struct Embed {
166 pub resolved: Resolved,
167 pub html: String,
168}
169
170impl Embed {
171 /// chat 消息 `embeds` 数组里的一项。
172 pub fn to_json(&self) -> serde_json::Value {
173 serde_json::json!({
174 "type": "platform",
175 "platform": self.resolved.platform,
176 "platform_name": self.resolved.platform_name,
177 "category": self.resolved.category.as_str(),
178 "kind": self.resolved.kind.as_str(),
179 "url": self.resolved.url,
180 "src": self.resolved.src,
181 "title": self.resolved.title,
182 "description": self.resolved.description,
183 "image_url": self.resolved.image_url,
184 "aspect": self.resolved.aspect.as_str(),
185 "html": self.html,
186 })
187 }
188}
Added lib/social/Cargo.toml lib/social/Cargo.toml +12 −0 View lib/social/Cargo.toml
@@ -0,0 +1,12 @@
1[package]
2name = "social"
3version.workspace = true
4edition.workspace = true
5
6[dependencies]
7percent-encoding = { workspace = true }
8regex = { workspace = true }
9serde = { workspace = true, features = ["derive"] }
10serde_json = { workspace = true }
11url = { workspace = true }
12utoipa = { workspace = true }
Modified Cargo.lock Cargo.lock +14 −0 View Cargo.lock
@@ -1275,6 +1275,7 @@
12751275 "serde_json",
12761276 "session",
12771277 "sha2 0.11.0",
1278 "social",
12781279 "space",
12791280 "storage",
12801281 "time 0.3.55",
@@ -2329,6 +2330,7 @@
23292330 "serde_json",
23302331 "storage",
23312332 "thiserror 2.0.20",
2333 "time 0.3.55",
23322334 "tokio",
23332335 "tower",
23342336 "tracing",
@@ -8825,6 +8827,18 @@
88258827]
88268828
88278829[[package]]
8830name = "social"
8831version = "1.0.0"
8832dependencies = [
8833 "percent-encoding 2.3.2",
8834 "regex",
8835 "serde",
8836 "serde_json",
8837 "url 2.5.8",
8838 "utoipa",
8839]
8840
8841[[package]]
88288842name = "socket2"
88298843version = "0.5.10"
88308844source = "registry+https://github.com/rust-lang/crates.io-index"
Modified Cargo.toml Cargo.toml +4 −0 View Cargo.toml
@@ -40,6 +40,7 @@
4040webapi = { path = "lib/webapi" }
4141pulls = { path = "lib/pulls" }
4242search = { path = "lib/search" }
43social = { path = "lib/social" }
4344web = { path = "web" }
4445
4546
@@ -115,3 +116,6 @@
115116
116117
117118serde_yaml_ng = "0.10"
119regex = "1"
120url = "2"
121percent-encoding = "2"