Skip to content

Commit

Permalink
MediaEmbed: updated WSJ
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Apr 24, 2024
1 parent ac0b75e commit 05b9223
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 53 deletions.
91 changes: 45 additions & 46 deletions src/Bundles/MediaPack.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Bundles/MediaPack/Renderer.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
'wavekit'=>['attributes'=>[],'example'=>['https://play.wavekit.app/share/audio/zrT3OPuSYa','https://play.wavekit.app/share/playlist/myVR1J1kNs'],'extract'=>['#play\\.wavekit\\.app/(?:embed|share)/audio/(?\'audio_id\'\\w+)#','#play\\.wavekit\\.app/(?:embed|share)/playlist/(?\'playlist_id\'\\w+)#'],'homepage'=>'https://wavekit.app/','host'=>['play.wavekit.app'],'iframe'=>['height'=>'<xsl:choose><xsl:when test="@playlist_id">40</xsl:when><xsl:otherwise>17</xsl:otherwise></xsl:choose>0','max-width'=>900,'src'=>'https://play.wavekit.app/embed/<xsl:choose><xsl:when test="@playlist_id">playlist/<xsl:value-of select="@playlist_id"/></xsl:when><xsl:otherwise>audio/<xsl:value-of select="@audio_id"/></xsl:otherwise></xsl:choose>','width'=>'100%'],'name'=>'Wavekit','scrape'=>[],'tags'=>['music']],
'wistia'=>['amp'=>['custom-element'=>'amp-wistia-player','src'=>'https://cdn.ampproject.org/v0/amp-wistia-player-0.1.js','template'=>'<amp-wistia-player layout="responsive" width="640" height="360" data-media-hashed-id="{@id}"/>'],'attributes'=>[],'choose'=>['otherwise'=>['iframe'=>['src'=>'https://fast.wistia.net/embed/iframe/{@id}']],'when'=>['iframe'=>['height'=>218,'max-width'=>900,'src'=>'https://fast.wistia.net/embed/iframe/{@id}','width'=>'100%'],'test'=>'@type = \'audio\'']],'example'=>['https://thoughtworks.wistia.com/medias/b6al55s35k','https://fast.wistia.com/embed/iframe/od5qgyo2uy'],'extract'=>['!wistia.com/(?:(?:embed/iframe|medias)/|.*wmediaid=)(?\'id\'\\w+)!'],'homepage'=>'https://wistia.com/','host'=>['wistia.com'],'name'=>'Wistia','scrape'=>[['extract'=>['!"type":"(?:\\w+_)?(?\'type\'audio)!'],'match'=>['!wistia.com/(?:(?:embed/iframe|medias)/|.*wmediaid=)\\w!'],'url'=>'https://fast.wistia.net/embed/iframe/{@id}']],'tags'=>['podcasts','videos']],
'wshh'=>['attributes'=>[],'example'=>['https://worldstar.com/video.php?v=wshhn7nmk3033k8m66ZG','https://www.worldstarhiphop.com/featured/71630'],'extract'=>['!worldstar(?:hiphop)?\\.com/(?:emb|featur)ed/(?\'id\'\\d+)!'],'homepage'=>'https://www.worldstarhiphop.com/','host'=>['worldstar.com','worldstarhiphop.com'],'iframe'=>['src'=>'//worldstarhiphop.com/embed/{@id}'],'name'=>'WorldStarHipHop','scrape'=>[['extract'=>['!(?:v: ?"?|worldstar(?:hiphop)?\\.com/embed/)(?\'id\'\\d+)!'],'match'=>['!worldstar(?:hiphop)?\\.com/(?:\\w+/)?video\\.php\\?v=\\w+!']]],'tags'=>['videos']],
'wsj'=>['attributes'=>[],'example'=>['https://www.wsj.com/video/nba-players-primp-with-pedicures/9E476D54-6A60-4F3F-ABC1-411014552DE6.html','https://live.wsj.com/#!09FB2B3B-583E-4284-99D8-FEF6C23BE4E2','https://live.wsj.com/video/seahawks-qb-russell-wilson-on-super-bowl-win/9B3DF790-9D20-442C-B564-51524B06FD26.html'],'extract'=>['@wsj\\.com/[^#]*#!(?\'id\'[-0-9A-F]{36})@','@wsj\\.com/video/[^/]+/(?\'id\'[-0-9A-F]{36})@'],'homepage'=>'https://www.wsj.com/video/','host'=>['wsj.com'],'iframe'=>['height'=>288,'src'=>'//video-api.wsj.com/api-video/player/iframe.html?guid={@id}','width'=>512],'name'=>'The Wall Street Journal Online','scrape'=>[['extract'=>['@guid=(?\'id\'[-0-9A-F]{36})@'],'match'=>['@on\\.wsj\\.com/\\w@']]],'tags'=>['news']],
'wsj'=>['attributes'=>[],'example'=>['https://www.wsj.com/video/nba-players-primp-with-pedicures/9E476D54-6A60-4F3F-ABC1-411014552DE6.html','https://live.wsj.com/#!09FB2B3B-583E-4284-99D8-FEF6C23BE4E2','https://live.wsj.com/video/seahawks-qb-russell-wilson-on-super-bowl-win/9B3DF790-9D20-442C-B564-51524B06FD26.html'],'extract'=>['@wsj\\.com/[^#]*#!(?\'id\'[-0-9A-F]{36})@','@wsj\\.com/video/[^/]+/(?\'id\'[-0-9A-F]{36})@'],'homepage'=>'https://www.wsj.com/video/','host'=>['wsj.com'],'iframe'=>['src'=>'//video-api.wsj.com/api-video/player/iframe.html?guid={@id}'],'name'=>'The Wall Street Journal Online','scrape'=>[['extract'=>['@wsj\\.com/video/[^/]+/(?\'id\'[-0-9A-F]{36})@'],'match'=>['@on\\.wsj\\.com/\\w@']]],'tags'=>['news']],
'xboxclips'=>['attributes'=>[],'example'=>'https://gameclips.io/boulderBaby5568/035a50fa-2d54-4820-aa44-f0f43a873308','extract'=>['@(?:gameclips\\.io|xboxclips\\.com)/(?!game/)(?\'user\'[^/]+)/(?!screenshots/)(?\'id\'[-0-9a-f]+)@'],'homepage'=>'https://gameclips.io/','host'=>['gameclips.io','xboxclips.com'],'iframe'=>['height'=>315,'src'=>'//gameclips.io/{@user}/{@id}/embed','width'=>560],'name'=>'GameClips.io','scrape'=>[],'tags'=>['gaming']],
'xboxdvr'=>['attributes'=>[],'example'=>'https://gamerdvr.com/gamer/LOXITANE/video/12463958','extract'=>['!(?:gamer|xbox)dvr\\.com/gamer/(?\'user\'[^/]+)/video/(?\'id\'\\d+)!'],'homepage'=>'https://gamerdvr.com/','host'=>['gamerdvr.com','xboxdvr.com'],'iframe'=>['src'=>'//gamerdvr.com/gamer/{@user}/video/{@id}/embed'],'name'=>'Gamer DVR','scrape'=>[],'tags'=>['gaming']],
'xenforo'=>['attributes'=>['content_id'=>['filterChain'=>['#identifier'],'required'=>false],'post_id'=>['filterChain'=>['#uint'],'required'=>false],'profile_post_id'=>['filterChain'=>['#uint'],'required'=>false],'resource_id'=>['filterChain'=>['#uint'],'required'=>false],'thread_id'=>['filterChain'=>['#uint'],'required'=>false],'url'=>['filterChain'=>['#url'],'required'=>true],'xfmg_album_id'=>['filterChain'=>['#uint'],'required'=>false]],'example'=>'https://xenforo.com/community/threads/embed-your-content-anywhere.217381/','extract'=>['!^(?\'url\'https://.*?/)media/albums/(?:[-\\w]+\\.)?(?\'xfmg_album_id\'\\d+)!','!^(?\'url\'https://.*?/)(?:members/[-.\\w]+/#profile-post-|profile-posts/)(?\'profile_post_id\'\\d+)!','!^(?\'url\'https://.*?/)resources/(?:[-\\w]+\\.)?(?\'resource_id\'\\d+)!','!^(?\'url\'https://.*?/)threads/(?:[-\\w]+\\.)?(?\'thread_id\'\\d+)/(?:page-\\d+)?#?(?:post-(?\'post_id\'\\d+))?!','!^(?\'url\'https://.*?/)embed\\.php\\?content=(?\'content_id\'[-\\w]+)!'],'host'=>[],'iframe'=>['data-s9e-livepreview-ignore-attrs'=>'style','height'=>300,'onload'=>'let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+\'px\';this.contentWindow.postMessage(\'s9e:init\',\'*\',[c.port2])','src'=>'https://s9e.github.io/iframe/2/xenforo.min.html#<xsl:value-of select="@url"/><xsl:choose><xsl:when test="@profile_post_id">profile-posts/<xsl:value-of select="@profile_post_id"/></xsl:when><xsl:when test="@resource_id">resources/<xsl:value-of select="@resource_id"/></xsl:when><xsl:when test="@xfmg_album_id">media/albums/<xsl:value-of select="@xfmg_album_id"/></xsl:when><xsl:otherwise>threads/<xsl:value-of select="@thread_id"/><xsl:if test="@post_id">/post-<xsl:value-of select="@post_id"/></xsl:if></xsl:otherwise></xsl:choose>','width'=>'100%'],'name'=>'XenForo','scrape'=>[],'tags'=>['social']],
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/MediaEmbed/Configurator/sites/wsj.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<extract>@wsj\.com/video/[^/]+/(?'id'[-0-9A-F]{36})@</extract>
<scrape>
<match>@on\.wsj\.com/\w@</match>
<extract>@guid=(?'id'[-0-9A-F]{36})@</extract>
<extract>@wsj\.com/video/[^/]+/(?'id'[-0-9A-F]{36})@</extract>
</scrape>
<iframe width="512" height="288" src="//video-api.wsj.com/api-video/player/iframe.html?guid={@id}"/>
<iframe src="//video-api.wsj.com/api-video/player/iframe.html?guid={@id}"/>
</site>
4 changes: 2 additions & 2 deletions tests/Plugins/MediaEmbed/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,8 @@ function ($configurator)
}
],
[
'http://on.wsj.com/1MJvx06',
'<r><WSJ id="9E476D54-6A60-4F3F-ABC1-411014552DE6">http://on.wsj.com/1MJvx06</WSJ></r>',
'https://on.wsj.com/1MJvx06',
'<r><WSJ id="9E476D54-6A60-4F3F-ABC1-411014552DE6">https://on.wsj.com/1MJvx06</WSJ></r>',
[],
function ($configurator)
{
Expand Down

0 comments on commit 05b9223

Please sign in to comment.