Skip to content

Commit

Permalink
MediaEmbed: removed Amazon
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Jan 5, 2024
1 parent 7c95e9d commit b1d809a
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 481 deletions.
4 changes: 0 additions & 4 deletions docs/Plugins/MediaEmbed/Sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
<td><code>acast</code></td>
<td>https://play.acast.com/s/the-taskmaster-podcast/ep31.leemack-s11ep.8<br/>https://shows.acast.com/chaotic-normal/episodes/the-rising-tide</td>
</tr>
<tr title="Amazon Product" id="amazon">
<td><code>amazon</code></td>
<td>https://www.amazon.ca/gp/product/B00GQT1LNO/<br/>https://www.amazon.co.jp/gp/product/B003AKZ6I8/<br/>https://www.amazon.co.uk/dp/B00EO4NN5C/<br/>https://www.amazon.com/dp/B002MUC0ZY<br/>https://www.amazon.com/The-BeerBelly-200-001-80-Ounce-Belly/dp/B001RB2CXY/<br/>https://www.amazon.com/gp/product/B00ST0KGCU/<br/>https://www.amazon.de/Netgear-WN3100RP-100PES-Repeater-integrierte-Steckdose/dp/B00ET2LTE6/<br/>https://www.amazon.es/Microsoft-Sculpt-Ergonomic-Desktop-L5V-00011/dp/B00FO10ZK0/<br/>https://www.amazon.fr/Vans-Authentic-Baskets-mixte-adulte/dp/B005NIKPAY/<br/>https://www.amazon.in/Vans-Unisex-Classic-Loafers-Moccasins/dp/B01I3LWMVC/<br/>https://www.amazon.it/Super-Maxi-Pot-de-Nutella/dp/B0090GJ8VM/<br/>https://www.amazon.com/dp/B0018CDWLS/</td>
</tr>
<tr title="Anchor" id="anchor">
<td><code>anchor</code></td>
<td>https://anchor.fm/aconversationwith/episodes/Answering-Voicemails-A-Conversation-With-You--2-e6e7lg</td>
Expand Down
38 changes: 1 addition & 37 deletions docs/Plugins/MediaEmbed/Using_default_sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ echo count($configurator->MediaEmbed->defaultSites), " sites remaining.\n";
```
Does YouTube exist? yes
What about now? no
131 sites remaining.
130 sites remaining.
0 sites remaining.
```

Expand All @@ -87,42 +87,6 @@ What about now? no
Some default sites support some level of configuration at runtime via template parameters.

<table>
<tr>
<td>AMAZON_ASSOCIATE_TAG</td>
<td>Amazon Associate tag (.com)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_CA</td>
<td>Amazon Associate tag (.ca)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_DE</td>
<td>Amazon Associate tag (.de)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_ES</td>
<td>Amazon Associate tag (.es)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_FR</td>
<td>Amazon Associate tag (.fr)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_IN</td>
<td>Amazon Associate tag (.in)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_IT</td>
<td>Amazon Associate tag (.it)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_JP</td>
<td>Amazon Associate tag (.co.jp)</td>
</tr>
<tr>
<td>AMAZON_ASSOCIATE_TAG_UK</td>
<td>Amazon Associate tag (.co.uk)</td>
</tr>
<tr>
<td>MEDIAEMBED_THEME</td>
<td>Either an empty string (default) or "dark" for dark theme</td>
Expand Down
60 changes: 0 additions & 60 deletions docs/testdox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2641,18 +2641,6 @@ PHP (s9e\TextFormatter\Tests\Configurator\RendererGenerators\PHP)
[x] Tests from plugins with data set #292
[x] Tests from plugins with data set #293
[x] Tests from plugins with data set #294
[x] Tests from plugins with data set #295
[x] Tests from plugins with data set #296
[x] Tests from plugins with data set #297
[x] Tests from plugins with data set #298
[x] Tests from plugins with data set #299
[x] Tests from plugins with data set #300
[x] Tests from plugins with data set #301
[x] Tests from plugins with data set #302
[x] Tests from plugins with data set #303
[x] Tests from plugins with data set #304
[x] Tests from plugins with data set #305
[x] Tests from plugins with data set #306
[x] Tests from plugins (Quick renderer) with data set #0
[x] Tests from plugins (Quick renderer) with data set #1
[x] Tests from plugins (Quick renderer) with data set #2
Expand Down Expand Up @@ -2948,18 +2936,6 @@ PHP (s9e\TextFormatter\Tests\Configurator\RendererGenerators\PHP)
[x] Tests from plugins (Quick renderer) with data set #292
[x] Tests from plugins (Quick renderer) with data set #293
[x] Tests from plugins (Quick renderer) with data set #294
[x] Tests from plugins (Quick renderer) with data set #295
[x] Tests from plugins (Quick renderer) with data set #296
[x] Tests from plugins (Quick renderer) with data set #297
[x] Tests from plugins (Quick renderer) with data set #298
[x] Tests from plugins (Quick renderer) with data set #299
[x] Tests from plugins (Quick renderer) with data set #300
[x] Tests from plugins (Quick renderer) with data set #301
[x] Tests from plugins (Quick renderer) with data set #302
[x] Tests from plugins (Quick renderer) with data set #303
[x] Tests from plugins (Quick renderer) with data set #304
[x] Tests from plugins (Quick renderer) with data set #305
[x] Tests from plugins (Quick renderer) with data set #306
[x] Creates a Quick renderer if $enableQuickRenderer is true
[x] Does not create a Quick renderer if $enableQuickRenderer is false

Expand Down Expand Up @@ -7238,18 +7214,6 @@ Parser (s9e\TextFormatter\Tests\Plugins\MediaEmbed\Parser)
[x] Parsing tests with data set #320
[x] Parsing tests with data set #321
[x] Parsing tests with data set #322
[x] Parsing tests with data set #323
[x] Parsing tests with data set #324
[x] Parsing tests with data set #325
[x] Parsing tests with data set #326
[x] Parsing tests with data set #327
[x] Parsing tests with data set #328
[x] Parsing tests with data set #329
[x] Parsing tests with data set #330
[x] Parsing tests with data set #331
[x] Parsing tests with data set #332
[x] Parsing tests with data set #333
[x] Parsing tests with data set #334
[x] Parsing tests (JavaScript) with data set #0
[x] Parsing tests (JavaScript) with data set #1
[x] Parsing tests (JavaScript) with data set #2
Expand Down Expand Up @@ -7573,18 +7537,6 @@ Parser (s9e\TextFormatter\Tests\Plugins\MediaEmbed\Parser)
[x] Parsing tests (JavaScript) with data set #320
[x] Parsing tests (JavaScript) with data set #321
[x] Parsing tests (JavaScript) with data set #322
[x] Parsing tests (JavaScript) with data set #323
[x] Parsing tests (JavaScript) with data set #324
[x] Parsing tests (JavaScript) with data set #325
[x] Parsing tests (JavaScript) with data set #326
[x] Parsing tests (JavaScript) with data set #327
[x] Parsing tests (JavaScript) with data set #328
[x] Parsing tests (JavaScript) with data set #329
[x] Parsing tests (JavaScript) with data set #330
[x] Parsing tests (JavaScript) with data set #331
[x] Parsing tests (JavaScript) with data set #332
[x] Parsing tests (JavaScript) with data set #333
[x] Parsing tests (JavaScript) with data set #334
[x] Parsing+rendering tests with data set #0
[x] Parsing+rendering tests with data set #1
[x] Parsing+rendering tests with data set #2
Expand Down Expand Up @@ -7672,18 +7624,6 @@ Parser (s9e\TextFormatter\Tests\Plugins\MediaEmbed\Parser)
[x] Parsing+rendering tests with data set #84
[x] Parsing+rendering tests with data set #85
[x] Parsing+rendering tests with data set #86
[x] Parsing+rendering tests with data set #87
[x] Parsing+rendering tests with data set #88
[x] Parsing+rendering tests with data set #89
[x] Parsing+rendering tests with data set #90
[x] Parsing+rendering tests with data set #91
[x] Parsing+rendering tests with data set #92
[x] Parsing+rendering tests with data set #93
[x] Parsing+rendering tests with data set #94
[x] Parsing+rendering tests with data set #95
[x] Parsing+rendering tests with data set #96
[x] Parsing+rendering tests with data set #97
[x] Parsing+rendering tests with data set #98

Parser Base (s9e\TextFormatter\Tests\Plugins\ParserBase)
[x] Has a default empty setUp() method
Expand Down
119 changes: 59 additions & 60 deletions src/Bundles/MediaPack.php

Large diffs are not rendered by default.

6 changes: 2 additions & 4 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 @@ -13,7 +13,6 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
protected $items = [
'abcnews'=>['attributes'=>[],'example'=>'https://abcnews.go.com/WNN/video/dog-goes-wild-when-owner-leaves-22936610','extract'=>['!abcnews\\.go\\.com/(?:video/embed\\?id=|[^/]+/video/[^/]+-)(?\'id\'\\d+)!'],'homepage'=>'https://abcnews.go.com/','host'=>['abcnews.go.com'],'iframe'=>['src'=>'//abcnews.go.com/video/embed?id={@id}'],'name'=>'ABC News','scrape'=>[],'tags'=>['news']],
'acast'=>['attributes'=>[],'example'=>['https://play.acast.com/s/the-taskmaster-podcast/ep31.leemack-s11ep.8','https://shows.acast.com/chaotic-normal/episodes/the-rising-tide'],'extract'=>['@play\\.acast\\.com/s/(?\'show_id\'[-.\\w]+)/(?\'episode_id\'[-.\\w]+)(?:\\?seek=(?\'t\'\\d+))?@','@shows\\.acast\\.com/(?\'show_id\'[-.\\w]+)/(?:episodes/)?(?\'episode_id\'[-.\\w]+)(?:\\?seek=(?\'t\'\\d+))?@'],'homepage'=>'https://play.acast.com/','host'=>['acast.com'],'iframe'=>['height'=>188,'max-width'=>900,'src'=>'https://embed.acast.com/{@show_id}/{@episode_id}?seek={@t}','width'=>'100%'],'name'=>'Acast','oembed'=>['endpoint'=>'https://oembed.acast.com/v1/embed-player','scheme'=>'https://play.acast.com/s/{@show_id}/{@episode_id}'],'scrape'=>[['extract'=>['@"showId":"(?\'show_id\'[-0-9a-f]+)@','@"id":"(?\'episode_id\'[-0-9a-f]+)@'],'match'=>['@play\\.acast\\.com/s/[-.\\w]+/.@','@shows\\.acast\\.com/[-.\\w]+/.@'],'url'=>'https://feeder.acast.com/api/v1/shows/{@show_id}/episodes/{@episode_id}']],'tags'=>['podcasts']],
'amazon'=>['attributes'=>['id'=>['required'=>true]],'example'=>['https://www.amazon.ca/gp/product/B00GQT1LNO/','https://www.amazon.co.jp/gp/product/B003AKZ6I8/','https://www.amazon.co.uk/dp/B00EO4NN5C/','https://www.amazon.com/dp/B002MUC0ZY','https://www.amazon.com/The-BeerBelly-200-001-80-Ounce-Belly/dp/B001RB2CXY/','https://www.amazon.com/gp/product/B00ST0KGCU/','https://www.amazon.de/Netgear-WN3100RP-100PES-Repeater-integrierte-Steckdose/dp/B00ET2LTE6/','https://www.amazon.es/Microsoft-Sculpt-Ergonomic-Desktop-L5V-00011/dp/B00FO10ZK0/','https://www.amazon.fr/Vans-Authentic-Baskets-mixte-adulte/dp/B005NIKPAY/','https://www.amazon.in/Vans-Unisex-Classic-Loafers-Moccasins/dp/B01I3LWMVC/','https://www.amazon.it/Super-Maxi-Pot-de-Nutella/dp/B0090GJ8VM/','https://www.amazon.com/dp/B0018CDWLS/'],'extract'=>['#/(?:dp|gp/product)/(?\'id\'[A-Z0-9]+)#','#amazon\\.(?:co\\.)?(?\'tld\'ca|de|es|fr|in|it|jp|uk)#'],'homepage'=>'https://affiliate-program.amazon.com/','host'=>['amazon.ca','amazon.co.uk','amazon.co.jp','amazon.com','amazon.de','amazon.es','amazon.fr','amazon.in','amazon.it'],'iframe'=>['height'=>240,'src'=>'//ws-<xsl:choose><xsl:when test="@tld=\'jp\'">fe</xsl:when><xsl:when test="@tld and contains(\'desfrinituk\',@tld)">eu</xsl:when><xsl:otherwise>na</xsl:otherwise></xsl:choose>.assoc-amazon.com/widgets/cm?l=as1&amp;f=ifr&amp;o=<xsl:choose><xsl:when test="@tld=\'ca\'">15&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_CA"/></xsl:when><xsl:when test="@tld=\'de\'">3&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_DE"/></xsl:when><xsl:when test="@tld=\'es\'">30&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_ES"/></xsl:when><xsl:when test="@tld=\'fr\'">8&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_FR"/></xsl:when><xsl:when test="@tld=\'in\'">31&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_IN"/></xsl:when><xsl:when test="@tld=\'it\'">29&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_IT"/></xsl:when><xsl:when test="@tld=\'jp\'">9&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_JP"/></xsl:when><xsl:when test="@tld=\'uk\'">2&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG_UK"/></xsl:when><xsl:otherwise>1&amp;t=<xsl:value-of select="$AMAZON_ASSOCIATE_TAG"/></xsl:otherwise></xsl:choose>&amp;asins=<xsl:value-of select="@id"/>','style'=>['background'=>'url(https://www.amazon.com/favicon.ico) center no-repeat'],'width'=>120],'name'=>'Amazon Product','parameters'=>['AMAZON_ASSOCIATE_TAG'=>['title'=>'Amazon Associate tag (.com)'],'AMAZON_ASSOCIATE_TAG_CA'=>['title'=>'Amazon Associate tag (.ca)'],'AMAZON_ASSOCIATE_TAG_DE'=>['title'=>'Amazon Associate tag (.de)'],'AMAZON_ASSOCIATE_TAG_ES'=>['title'=>'Amazon Associate tag (.es)'],'AMAZON_ASSOCIATE_TAG_FR'=>['title'=>'Amazon Associate tag (.fr)'],'AMAZON_ASSOCIATE_TAG_IN'=>['title'=>'Amazon Associate tag (.in)'],'AMAZON_ASSOCIATE_TAG_IT'=>['title'=>'Amazon Associate tag (.it)'],'AMAZON_ASSOCIATE_TAG_JP'=>['title'=>'Amazon Associate tag (.co.jp)'],'AMAZON_ASSOCIATE_TAG_UK'=>['title'=>'Amazon Associate tag (.co.uk)']],'scrape'=>[]],
'anchor'=>['attributes'=>[],'example'=>'https://anchor.fm/aconversationwith/episodes/Answering-Voicemails-A-Conversation-With-You--2-e6e7lg','extract'=>['@anchor.fm/(?:[-\\w]+/)*?episodes/(?:[-\\w]+-)(?\'id\'\\w+)(?![-\\w])@'],'homepage'=>'https://anchor.fm/','host'=>['anchor.fm'],'iframe'=>['height'=>102,'max-width'=>768,'src'=>'//anchor.fm/x/embed/episodes/x-{@id}','width'=>'100%'],'name'=>'Anchor','scrape'=>[],'tags'=>['podcasts']],
'applepodcasts'=>['attributes'=>[],'choose'=>['otherwise'=>['iframe'=>['allow'=>'autoplay *;encrypted-media *','height'=>450,'max-width'=>900,'src'=>'https://embed.podcasts.apple.com/{@country}/podcast/episode/id{@podcast_id}?theme={$MEDIAEMBED_THEME}','width'=>'100%']],'when'=>['iframe'=>['allow'=>'autoplay *;encrypted-media *','height'=>175,'max-width'=>900,'src'=>'https://embed.podcasts.apple.com/{@country}/podcast/episode/id{@podcast_id}?theme={$MEDIAEMBED_THEME}&i={@episode_id}','width'=>'100%'],'test'=>'@episode_id']],'example'=>['https://podcasts.apple.com/us/podcast/the-office-deep-dive-with-brian-baumgartner/id1550331348','https://podcasts.apple.com/us/podcast/the-office-deep-dive-with-brian-baumgartner/id1550331348?i=1000514199106'],'extract'=>['@podcasts\\.apple\\.com/(?\'country\'\\w+)/podcast/[-\\w]*/id(?\'podcast_id\'\\d+)(?:\\?i=(?\'episode_id\'\\d+))?@'],'homepage'=>'https://podcasts.apple.com/','host'=>['podcasts.apple.com'],'name'=>'Apple Podcasts','scrape'=>[],'tags'=>['podcasts']],
'audioboom'=>['attributes'=>[],'example'=>'https://audioboom.com/posts/2493448-robert-patrick','extract'=>['!audioboo(?:\\.f|m\\.co)m/(?:boo|post)s/(?\'id\'\\d+)!'],'homepage'=>'https://audioboom.com/','host'=>['audioboo.fm','audioboom.com'],'iframe'=>['height'=>150,'max-width'=>700,'src'=>'//audioboom.com/posts/{@id}/embed/v3','width'=>'100%'],'name'=>'Audioboom','scrape'=>[],'tags'=>['podcasts']],
Expand Down
94 changes: 0 additions & 94 deletions src/Plugins/MediaEmbed/Configurator/sites/amazon.xml

This file was deleted.

Loading

0 comments on commit b1d809a

Please sign in to comment.