Skip to content

Commit

Permalink
MediaEmbed: updated Threads
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Jan 2, 2024
1 parent e4eb30c commit 7c95e9d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Bundles/MediaPack.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
'theatlantic'=>['attributes'=>[],'example'=>'https://www.theatlantic.com/video/index/358928/computer-vision-syndrome-and-you/','extract'=>['!theatlantic\\.com/video/index/(?\'id\'\\d+)!'],'homepage'=>'https://www.theatlantic.com/video/','host'=>['theatlantic.com'],'iframe'=>['src'=>'//www.theatlantic.com/video/iframe/{@id}/'],'name'=>'The Atlantic Video','scrape'=>[],'tags'=>['news']],
'theguardian'=>['attributes'=>[],'example'=>'https://www.theguardian.com/world/video/2016/apr/07/tokyos-hedgehog-cafe-encourages-you-to-embrace-prickly-pets-video','extract'=>['!theguardian\\.com/(?\'id\'\\w+/video/20(?:0[0-9]|1[0-7])[-/\\w]+)!'],'homepage'=>'https://www.theguardian.com/video','host'=>['theguardian.com'],'iframe'=>['src'=>'//embed.theguardian.com/embed/video/{@id}'],'name'=>'The Guardian (obsolete)','scrape'=>[],'tags'=>['news']],
'theonion'=>['attributes'=>[],'example'=>['https://www.theonion.com/video/nation-successfully-completes-mothers-day-by-918-a,35998/','https://www.theonion.com/video/the-onion-reviews-avengers-age-of-ultron-38524'],'extract'=>['!theonion\\.com/video/[-\\w]+[-,](?\'id\'\\d+)!'],'homepage'=>'https://www.theonion.com/video/','host'=>['theonion.com'],'iframe'=>['src'=>'//www.theonion.com/video_embed/?id={@id}'],'name'=>'The Onion','scrape'=>[],'tags'=>['entertainment']],
'threads'=>['attributes'=>[],'example'=>'https://www.threads.net/t/CuY2OYEAbJw','extract'=>['!threads\\.net/(?:@[-\\w]+/pos)?t/(?\'id\'[-\\w]+)!'],'homepage'=>'https://www.threads.net/','host'=>['threads.net'],'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/threads.min.html#{@id}','width'=>550],'name'=>'Threads','scrape'=>[],'tags'=>['social']],
'threads'=>['attributes'=>[],'example'=>'https://www.threads.net/t/CuY2OYEAbJw','extract'=>['!threads\\.net/(?:@[-\\w.]+/pos)?t/(?\'id\'[-\\w]+)!'],'homepage'=>'https://www.threads.net/','host'=>['threads.net'],'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/threads.min.html#{@id}','width'=>550],'name'=>'Threads','scrape'=>[],'tags'=>['social']],
'tiktok'=>['attributes'=>[],'example'=>'https://www.tiktok.com/@lauren.feagans/video/6789430799839104261','extract'=>['#tiktok\\.com/(?:@[.\\w]+/video|v|(?:i18n/)?share/video)/(?\'id\'\\d+)#'],'homepage'=>'https://www.tiktok.com','host'=>['tiktok.com'],'iframe'=>['data-s9e-livepreview-ignore-attrs'=>'style','height'=>740,'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/tiktok.min.html#{@id}','width'=>325],'name'=>'TikTok','oembed'=>['endpoint'=>'https://www.tiktok.com/oembed','scheme'=>'https://www.tiktok.com/video/{@id}'],'scrape'=>[['extract'=>['#tiktok\\.com/(?:@[.\\w]+/video|v|(?:i18n/)?/share/video)/(?\'id\'\\d+)#'],'match'=>['#//v[mt]\\.tiktok\\.com/(?\'short_id\'\\w+)#','#tiktok\\.com/t/(?\'short_id\'\\w+)#'],'url'=>'https://www.tiktok.com/t/{@short_id}']],'tags'=>['videos']],
'tmz'=>['attributes'=>[],'example'=>'https://www.tmz.com/videos/0_2pr9x3rb/','extract'=>['@tmz\\.com/videos/(?\'id\'\\w+)@'],'homepage'=>'https://www.tmz.com/videos','host'=>['tmz.com'],'iframe'=>['src'=>'//www.kaltura.com/index.php/kwidget/cache_st/133592691/wid/_591531/partner_id/591531/uiconf_id/9071262/entry_id/{@id}'],'name'=>'TMZ','scrape'=>[],'tags'=>['gossip']],
'tradingview'=>['attributes'=>[],'example'=>['https://www.tradingview.com/symbols/NASDAQ-AAPL/','https://www.tradingview.com/chart/US30/Yro4JNSD-us30/'],'extract'=>['!tradingview\\.com/(?:chart/[^/]+|i)/(?\'chart\'\\w+)!','!tradingview\\.com/symbols/(?\'symbol\'[-:\\w]+)!'],'homepage'=>'https://www.tradingview.com/','host'=>['tradingview.com'],'iframe'=>['height'=>400,'src'=>'https://s.tradingview.com/<xsl:choose><xsl:when test="@symbol">widgetembed/?interval=D&amp;symbol=<xsl:value-of select="translate(@symbol,\'-\',\':\')"/></xsl:when><xsl:otherwise>embed/<xsl:value-of select="@chart"/></xsl:otherwise></xsl:choose>','width'=>'100%'],'name'=>'TradingView','scrape'=>[],'tags'=>['finance']],
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/MediaEmbed/Configurator/sites/threads.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<tags><tag>social</tag></tags>

<host>threads.net</host>
<extract>!threads\.net/(?:@[-\w]+/pos)?t/(?'id'[-\w]+)!</extract>
<extract>!threads\.net/(?:@[-\w.]+/pos)?t/(?'id'[-\w]+)!</extract>
<iframe width="550" height="300" src="https://s9e.github.io/iframe/2/threads.min.html#{@id}" onload="let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+'px';this.contentWindow.postMessage('s9e:init','*',[c.port2])" data-s9e-livepreview-ignore-attrs="style"/>
</site>
4 changes: 2 additions & 2 deletions tests/Plugins/MediaEmbed/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3536,8 +3536,8 @@ function ($configurator)
}
],
[
'https://www.threads.net/t/CuY2OYEAbJw',
'<r><THREADS id="CuY2OYEAbJw">https://www.threads.net/t/CuY2OYEAbJw</THREADS></r>',
'https://www.threads.net/@britain.elects/post/CwpU1kGIljY?hl=en-gb',
'<r><THREADS id="CwpU1kGIljY">https://www.threads.net/@britain.elects/post/CwpU1kGIljY?hl=en-gb</THREADS></r>',
[],
function ($configurator)
{
Expand Down

0 comments on commit 7c95e9d

Please sign in to comment.