Skip to content

Commit

Permalink
Merge pull request #96 from iMattPro/updates
Browse files Browse the repository at this point in the history
Add some more media sites
  • Loading branch information
iMattPro committed Mar 10, 2023
2 parents 38bb236 + 3997712 commit cc81e13
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 6 additions & 0 deletions collection/sites/bilibili.yml
Original file line number Diff line number Diff line change
@@ -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}
17 changes: 17 additions & 0 deletions collection/sites/mastodon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +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#<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"/>
6 changes: 6 additions & 0 deletions collection/sites/tenor.yml
Original file line number Diff line number Diff line change
@@ -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}
3 changes: 3 additions & 0 deletions tests/custom_sites_collection_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit cc81e13

Please sign in to comment.