From 57f5bb9ed7502c532a7ab4d3cbc5cf9d06025eee Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 6 Mar 2023 13:17:51 -0800 Subject: [PATCH 1/6] Add Tenor Signed-off-by: Matt Friedman --- collection/sites/tenor.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 collection/sites/tenor.yml diff --git a/collection/sites/tenor.yml b/collection/sites/tenor.yml new file mode 100644 index 0000000..5cde98c --- /dev/null +++ b/collection/sites/tenor.yml @@ -0,0 +1,6 @@ +name: Tenor +host: tenor.com +example: https://tenor.com/view/palpatine-smile-creepy-creepy-smile-smirk-gif-24584761 +extract: "!//tenor.com/.*-(?'id'\\d+)!" +iframe: + src: //tenor.com/embed/{@id} From c586722aca714a7a7fcb9d287b14f0ba4fd376a1 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 6 Mar 2023 13:18:04 -0800 Subject: [PATCH 2/6] Add Bilibili Signed-off-by: Matt Friedman --- collection/sites/bilibili.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 collection/sites/bilibili.yml diff --git a/collection/sites/bilibili.yml b/collection/sites/bilibili.yml new file mode 100644 index 0000000..9f5222d --- /dev/null +++ b/collection/sites/bilibili.yml @@ -0,0 +1,6 @@ +name: Bilibili +host: bilibili.com +example: https://www.bilibili.com/video/BV1VD4y1n7g7 +extract: "!//www.bilibili.com/video/(?'id'\\w+)!" +iframe: + src: //player.bilibili.com/player.html?bvid={@id} From ac74773d7dab51d371a25d3ec106c92f48194b84 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 6 Mar 2023 13:18:11 -0800 Subject: [PATCH 3/6] Add Mastodon Signed-off-by: Matt Friedman --- collection/sites/mastodon.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 collection/sites/mastodon.yml diff --git a/collection/sites/mastodon.yml b/collection/sites/mastodon.yml new file mode 100644 index 0000000..d8140d1 --- /dev/null +++ b/collection/sites/mastodon.yml @@ -0,0 +1,18 @@ +name: "Mastodon" +host: mastodon.social +example: https://mastodon.social/@HackerNewsBot/100181134752056592 +extract: "!//(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!" +oembed: + endpoint: https://mastodon.social/api/oembed + scheme: https://mastodon.social/@{@name}/{@id} +scrape: + - extract: + url: "!https://(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!" + - match: "!^(?'origin'https://[^/]+)/@\\w+@[-.\\w]+/(?'id'\\d+)!" + - url: "{@origin}/api/v1/statuses/{@id}" +iframe: + data-s9e-livepreview-ignore-attrs: "style" + onload: "let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+'px';this.contentWindow.postMessage('s9e:init','*',[c.port2])" + width: "550" + height: "300" + src: https://s9e.github.io/iframe/2/mastodon.min.html#@/ From 34094c688f405bc46efab93f14610d625111a598 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 6 Mar 2023 13:18:19 -0800 Subject: [PATCH 4/6] Update readme Signed-off-by: Matt Friedman --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 19ac1b3..c094acf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # phpBB Media Embed PlugIn -An extension for phpBB 3.2 that allows the user to embed content from allowed sites using a [media] BBCode, or from simply posting a supported URL in plain text. +An extension for phpBB that allows the user to embed content from allowed sites using a [media] BBCode, or from simply posting a supported URL in plain text. [![Build Status](https://github.com/phpbb-extensions/mediaembed/workflows/Tests/badge.svg)](https://github.com/phpbb-extensions/mediaembed/actions) [![codecov](https://codecov.io/gh/phpbb-extensions/mediaembed/branch/master/graph/badge.svg?token=EzEFamVD12)](https://codecov.io/gh/phpbb-extensions/mediaembed) From 1c8b369af1260016d050652399d23cbfeabff0ef Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 6 Mar 2023 13:19:30 -0800 Subject: [PATCH 5/6] Update tests Signed-off-by: Matt Friedman --- tests/custom_sites_collection_test.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/custom_sites_collection_test.php b/tests/custom_sites_collection_test.php index e5c4088..18361e7 100644 --- a/tests/custom_sites_collection_test.php +++ b/tests/custom_sites_collection_test.php @@ -47,12 +47,15 @@ public function test_get_collection() $collection = $customsitescollection->get_collection(); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/allocine.yml', $collection); + $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/bilibili.yml', $collection); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/dotsub.yml', $collection); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/ebaumsworld.yml', $collection); + $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/mastodon.yml', $collection); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/moddb.yml', $collection); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/ok.yml', $collection); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/schooltube.yml', $collection); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/snotr.yml', $collection); + $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/tenor.yml', $collection); $this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/videopress.yml', $collection); $this->assertNotContains('phpBB/ext/phpbb/mediaembed/collection/sites/youtube.yml', $collection); } From 39977128e39949885ac250589efd0514f286e6ca Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 7 Mar 2023 13:00:12 -0800 Subject: [PATCH 6/6] Update Mastodon Signed-off-by: Matt Friedman --- collection/sites/mastodon.yml | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/collection/sites/mastodon.yml b/collection/sites/mastodon.yml index d8140d1..366d662 100644 --- a/collection/sites/mastodon.yml +++ b/collection/sites/mastodon.yml @@ -1,18 +1,17 @@ -name: "Mastodon" -host: mastodon.social -example: https://mastodon.social/@HackerNewsBot/100181134752056592 -extract: "!//(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!" -oembed: - endpoint: https://mastodon.social/api/oembed - scheme: https://mastodon.social/@{@name}/{@id} -scrape: - - extract: - url: "!https://(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!" - - match: "!^(?'origin'https://[^/]+)/@\\w+@[-.\\w]+/(?'id'\\d+)!" - - url: "{@origin}/api/v1/statuses/{@id}" -iframe: - data-s9e-livepreview-ignore-attrs: "style" - onload: "let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+'px';this.contentWindow.postMessage('s9e:init','*',[c.port2])" - width: "550" - height: "300" - src: https://s9e.github.io/iframe/2/mastodon.min.html#@/ +name: "Mastodon" +host: mastodon.social +example: https://mastodon.social/@HackerNewsBot/100181134752056592 +extract: "!//(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!" +oembed: + endpoint: https://mastodon.social/api/oembed + scheme: https://mastodon.social/@{@name}/{@id} +scrape: + - extract: "!\"url\":\"https://(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)\"!" + - match: "!^(?'origin'https://[^/]+)/@\\w+@[-.\\w]+/(?'id'\\d+)!" + - url: "{@origin}/api/v1/statuses/{@id}" +iframe: + data-s9e-livepreview-ignore-attrs: "style" + onload: "let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+'px';this.contentWindow.postMessage('s9e:init','*',[c.port2])" + width: "550" + height: "300" + src: https://s9e.github.io/iframe/2/mastodon.min.html#@/