Skip to content

Commit 8346e81

Browse files
committed
MediaEmbed: added Crankers
1 parent cb1368c commit 8346e81

6 files changed

Lines changed: 39 additions & 27 deletions

File tree

docs/Plugins/MediaEmbed/Using_default_sites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ echo count($configurator->MediaEmbed->defaultSites), " sites remaining.\n";
7777
```
7878
Does YouTube exist? yes
7979
What about now? no
80-
135 sites remaining.
80+
136 sites remaining.
8181
0 sites remaining.
8282
```
8383

docs/testdox.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7308,6 +7308,7 @@ Parser (s9e\TextFormatter\Tests\Plugins\MediaEmbed\Parser)
73087308
[x] Parsing tests with data set #345
73097309
[x] Parsing tests with data set #346
73107310
[x] Parsing tests with data set #347
7311+
[x] Parsing tests with data set #348
73117312
[x] Parsing tests (JavaScript) with data set #0
73127313
[x] Parsing tests (JavaScript) with data set #1
73137314
[x] Parsing tests (JavaScript) with data set #2
@@ -7656,6 +7657,7 @@ Parser (s9e\TextFormatter\Tests\Plugins\MediaEmbed\Parser)
76567657
[x] Parsing tests (JavaScript) with data set #345
76577658
[x] Parsing tests (JavaScript) with data set #346
76587659
[x] Parsing tests (JavaScript) with data set #347
7660+
[x] Parsing tests (JavaScript) with data set #348
76597661
[x] Parsing+rendering tests with data set #0
76607662
[x] Parsing+rendering tests with data set #1
76617663
[x] Parsing+rendering tests with data set #2

src/Bundles/MediaPack.php

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

src/Bundles/MediaPack/Renderer.php

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

src/Plugins/MediaEmbed/Configurator/Collections/CachedDefinitionCollection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
3434
'codepen'=>['attributes'=>[],'example'=>'https://codepen.io/ainalem/pen/wvKOEMV','extract'=>['!codepen\\.io/(?\'user\'[-\\w]+)/(?:details|embed|full|live|pen)/(?\'id\'\\w+)!'],'homepage'=>'https://codepen.io/','host'=>['codepen.io'],'iframe'=>['height'=>400,'src'=>'https://codepen.io/{@user}/embed/{@id}?height=400&default-tab=html,result','width'=>'100%'],'name'=>'CodePen','scrape'=>[],'tags'=>['programming']],
3535
'comedycentral'=>['attributes'=>[],'example'=>['https://www.cc.com/video-clips/uu5qz4/key-and-peele-dueling-hats','https://www.comedycentral.com/video-clips/uu5qz4/key-and-peele-dueling-hats','https://tosh.cc.com/video-clips/aet4lh/rc-car-crash'],'extract'=>[],'homepage'=>'https://www.cc.com/','host'=>['cc.com','comedycentral.com'],'iframe'=>['src'=>'//media.mtvnservices.com/embed/{@id}'],'name'=>'Comedy Central','scrape'=>[['extract'=>['!(?\'id\'mgid:arc:(?:episode|video):[.\\w]+:[-\\w]+)!'],'match'=>['!c(?:c|omedycentral)\\.com/(?:full-episode|video-clip)s/!']]],'tags'=>['entertainment']],
3636
'coub'=>['attributes'=>[],'example'=>'https://coub.com/view/6veusoty','extract'=>['!coub\\.com/view/(?\'id\'\\w+)!'],'homepage'=>'https://coub.com/','host'=>['coub.com'],'iframe'=>['src'=>'//coub.com/embed/{@id}'],'name'=>'Coub','scrape'=>[],'tags'=>['videos']],
37+
'crankers'=>['attributes'=>[],'example'=>'https://crankers.com/videos/2676/russian-boxer-lets-endangered-orangutan-hit-the-vape/','extract'=>['@crankers\\.com/(?:embed|videos)/(?\'id\'[0-9]+)@'],'homepage'=>'https://crankers.com/','host'=>['crankers.com'],'iframe'=>['src'=>'//crankers.com/embed/{@id}'],'name'=>'Crankers Videos','scrape'=>[],'tags'=>['videos']],
3738
'dailymotion'=>['amp'=>['custom-element'=>'amp-dailymotion','src'=>'https://cdn.ampproject.org/v0/amp-dailymotion-0.1.js','template'=>'<amp-dailymotion layout="responsive" width="640" height="360" data-start="{@t}" data-videoid="{@id}"/>'],'attributes'=>[],'example'=>['https://dai.ly/x5e9eog','https://www.dailymotion.com/video/x5e9eog'],'extract'=>['!dai\\.ly/(?\'id\'[a-z0-9]+)!i','!dailymotion\\.com/(?:live/|swf/|user/[^#]+#video=|(?:related/\\d+/)?video/)(?\'id\'[a-z0-9]+)!i','!start=(?\'t\'\\d+)!'],'homepage'=>'https://www.dailymotion.com/','host'=>['dai.ly','dailymotion.com'],'iframe'=>['src'=>'//www.dailymotion.com/embed/video/<xsl:value-of select="@id"/><xsl:if test="@t">?start=<xsl:value-of select="@t"/></xsl:if>'],'name'=>'Dailymotion','oembed'=>['endpoint'=>'https://www.dailymotion.com/services/oembed','scheme'=>'https://www.dailymotion.com/video/{@id}'],'scrape'=>[],'source'=>'http://www.dailymotion.com/doc/api/player.html','tags'=>['videos']],
3839
'democracynow'=>['attributes'=>[],'example'=>['https://www.democracynow.org/2014/7/2/dn_at_almedalen_week_at_swedens','https://www.democracynow.org/blog/2015/3/13/part_2_bruce_schneier_on_the','https://www.democracynow.org/shows/2006/2/20','https://www.democracynow.org/2015/5/21/headlines','https://m.democracynow.org/stories/15236'],'extract'=>['!democracynow.org/(?:embed/)?(?\'id\'(?:\\w+/)?\\d+/\\d+/\\d+(?:/\\w+)?)!'],'homepage'=>'https://www.democracynow.org/','host'=>['democracynow.org'],'iframe'=>['src'=>'//www.democracynow.org/embed/<xsl:choose><xsl:when test="contains(@id,\'/headlines\')">headlines/<xsl:value-of select="substring-before(@id,\'/headlines\')"/></xsl:when><xsl:when test="starts-with(@id,\'2\')">story/<xsl:value-of select="@id"/></xsl:when><xsl:when test="starts-with(@id,\'shows/\')">show/<xsl:value-of select="substring-after(@id,\'/\')"/></xsl:when><xsl:otherwise><xsl:value-of select="@id"/></xsl:otherwise></xsl:choose>'],'name'=>'Democracy Now!','scrape'=>[['extract'=>['!democracynow\\.org/(?\'id\'(?:\\w+/)?\\d+/\\d+/\\d+(?:/\\w+)?)\' rel=\'canonical!'],'match'=>['!m\\.democracynow\\.org/stories/\\d!']]]],
3940
'dumpert'=>['attributes'=>[],'example'=>'https://www.dumpert.nl/item/6622577_4652b140','extract'=>['!dumpert\\.nl/(?:item|mediabase)/(?\'id\'\\d+[/_]\\w+)!'],'homepage'=>'https://www.dumpert.nl/','host'=>['dumpert.nl'],'iframe'=>['src'=>'//www.dumpert.nl/embed/{translate(@id,\'/\',\'_\')}'],'name'=>'dumpert','scrape'=>[],'tags'=>['.nl','entertainment']],

tests/Plugins/MediaEmbed/ParserTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,15 @@ function ($configurator)
16831683
$configurator->MediaEmbed->add('coub');
16841684
}
16851685
],
1686+
[
1687+
'https://crankers.com/videos/2676/russian-boxer-lets-endangered-orangutan-hit-the-vape/',
1688+
'<r><CRANKERS id="2676">https://crankers.com/videos/2676/russian-boxer-lets-endangered-orangutan-hit-the-vape/</CRANKERS></r>',
1689+
[],
1690+
function ($configurator)
1691+
{
1692+
$configurator->MediaEmbed->add('crankers');
1693+
}
1694+
],
16861695
[
16871696
'http://www.dailymotion.com/video/x222z1',
16881697
'<r><DAILYMOTION id="x222z1">http://www.dailymotion.com/video/x222z1</DAILYMOTION></r>',

0 commit comments

Comments
 (0)