Skip to content

Commit cc81e13

Browse files
authored
Merge pull request #96 from iMattPro/updates
Add some more media sites
2 parents 38bb236 + 3997712 commit cc81e13

5 files changed

Lines changed: 33 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# phpBB Media Embed PlugIn
22

3-
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.
3+
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.
44

55
[![Build Status](https://github.com/phpbb-extensions/mediaembed/workflows/Tests/badge.svg)](https://github.com/phpbb-extensions/mediaembed/actions)
66
[![codecov](https://codecov.io/gh/phpbb-extensions/mediaembed/branch/master/graph/badge.svg?token=EzEFamVD12)](https://codecov.io/gh/phpbb-extensions/mediaembed)

collection/sites/bilibili.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: Bilibili
2+
host: bilibili.com
3+
example: https://www.bilibili.com/video/BV1VD4y1n7g7
4+
extract: "!//www.bilibili.com/video/(?'id'\\w+)!"
5+
iframe:
6+
src: //player.bilibili.com/player.html?bvid={@id}

collection/sites/mastodon.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Mastodon"
2+
host: mastodon.social
3+
example: https://mastodon.social/@HackerNewsBot/100181134752056592
4+
extract: "!//(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!"
5+
oembed:
6+
endpoint: https://mastodon.social/api/oembed
7+
scheme: https://mastodon.social/@{@name}/{@id}
8+
scrape:
9+
- extract: "!\"url\":\"https://(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)\"!"
10+
- match: "!^(?'origin'https://[^/]+)/@\\w+@[-.\\w]+/(?'id'\\d+)!"
11+
- url: "{@origin}/api/v1/statuses/{@id}"
12+
iframe:
13+
data-s9e-livepreview-ignore-attrs: "style"
14+
onload: "let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+'px';this.contentWindow.postMessage('s9e:init','*',[c.port2])"
15+
width: "550"
16+
height: "300"
17+
src: https://s9e.github.io/iframe/2/mastodon.min.html#<xsl:value-of select="@name"/><xsl:if test="@host and@host!='mastodon.social'">@<xsl:value-of select="@host"/></xsl:if>/<xsl:value-of select="@id"/>

collection/sites/tenor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: Tenor
2+
host: tenor.com
3+
example: https://tenor.com/view/palpatine-smile-creepy-creepy-smile-smirk-gif-24584761
4+
extract: "!//tenor.com/.*-(?'id'\\d+)!"
5+
iframe:
6+
src: //tenor.com/embed/{@id}

tests/custom_sites_collection_test.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ public function test_get_collection()
4747
$collection = $customsitescollection->get_collection();
4848

4949
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/allocine.yml', $collection);
50+
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/bilibili.yml', $collection);
5051
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/dotsub.yml', $collection);
5152
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/ebaumsworld.yml', $collection);
53+
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/mastodon.yml', $collection);
5254
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/moddb.yml', $collection);
5355
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/ok.yml', $collection);
5456
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/schooltube.yml', $collection);
5557
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/snotr.yml', $collection);
58+
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/tenor.yml', $collection);
5659
$this->assertContains('phpBB/ext/phpbb/mediaembed/collection/sites/videopress.yml', $collection);
5760
$this->assertNotContains('phpBB/ext/phpbb/mediaembed/collection/sites/youtube.yml', $collection);
5861
}

0 commit comments

Comments
 (0)