Skip to content

Commit

Permalink
Added support for Podbean audio podcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Jun 2, 2014
1 parent 78eb76d commit c2e7aa1
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -179,6 +179,11 @@ Media BB Codes for XenForo, imported from [s9e\TextFormatter](https://github.com
<td>The New York Times Video</td>
<td>http://www.nytimes.com/video/technology/personaltech/100000002907606/soylent-taste-test.html<br/>http://www.nytimes.com/video/2012/12/17/business/100000001950744/how-wal-mart-conquered-teotihuacan.html</td>
</tr>
<tr>
<td><code>podbean</code></td>
<td>Podbean</td>
<td>http://dialhforheroclix.podbean.com/e/dial-h-for-heroclix-episode-46-all-ya-need-is-love/</td>
</tr>
<tr>
<td><code>rdio</code></td>
<td>Rdio</td>
Expand Down
7 changes: 6 additions & 1 deletion build/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<addon addon_id="s9e" title="s9e Media Pack" url="https://github.com/s9e/XenForoMediaBBCodes" version_id="20140601" version_string="201406010" install_callback_class="s9e_MediaBBCodes" install_callback_method="install">
<addon addon_id="s9e" title="s9e Media Pack" url="https://github.com/s9e/XenForoMediaBBCodes" version_id="20140602" version_string="201406020" install_callback_class="s9e_MediaBBCodes" install_callback_method="install">
<bb_code_media_sites>
<site media_site_id="abcnews" site_title="ABC News" site_url="http://abcnews.go.com/" match_is_regex="1" supported="1">
<match_urls>!abcnews\.go\.com/[^/]+/video/[^/]+-(?'id'\d+)!</match_urls>
Expand Down Expand Up @@ -147,6 +147,11 @@
!nytimes\.com/video/\d+/\d+/\d+/[a-z]+/(?'id'\d+)!</match_urls>
<embed_html><![CDATA[<iframe width="480" height="373" src="http://graphics8.nytimes.com/bcvideo/1.0/iframe/embed.html?videoId={$id}&amp;playerType=embed" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="podbean" site_title="Podbean" site_url="http://www.podbean.com/" match_is_regex="1" supported="1" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchPodbean">
<match_urls>!(?=.*?podbean\.com).*?podbean.com/site/player/index/pid/\d+/eid/(?'id'\d+)!
!(?'id')podbean.com/e/!</match_urls>
<embed_html><![CDATA[<iframe width="300" height="100" src="http://www.podbean.com/media/player/audio/postId/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="rdio" site_title="Rdio" site_url="http://www.rdio.com/" match_is_regex="1" supported="1" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchRdio">
<match_urls>!rd\.io/./(?'id'\w+)!
!(?'id')rdio\.com/.*?(?:playlist|track)!</match_urls>
Expand Down
13 changes: 13 additions & 0 deletions build/upload/library/s9e/MediaBBCodes.php
Expand Up @@ -573,6 +573,19 @@ public static function matchMixcloud($url)
return self::match($url, $regexps, $scrapes);
}

public static function matchPodbean($url)
{
$regexps = array('!(?=.*?podbean\\.com).*?podbean.com/site/player/index/pid/\\d+/eid/(?\'id\'\\d+)!');
$scrapes = array(
array(
'match' => array('!podbean.com/e/!'),
'extract' => array('!embed/postId/(?\'id\'\\d+)!')
)
);

return self::match($url, $regexps, $scrapes);
}

public static function matchRdio($url)
{
$regexps = array('!rd\\.io/./(?\'id\'\\w+)!');
Expand Down
5 changes: 5 additions & 0 deletions tests/Test.php
Expand Up @@ -282,6 +282,11 @@ public function getMatchCallbackTests()
'http://www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/video.html',
'id=1869987317%2Fwish-i-was-here-1;video=video'
),
array(
'podbean',
'http://wendyswordsofwisdom.podbean.com/e/tiffany-stevensons-words-of-wisdom/',
'5168723'
),
array(
'rdio',
'http://rd.io/x/QcD7oTdeWevg/',
Expand Down
8 changes: 7 additions & 1 deletion www/configure.html

Large diffs are not rendered by default.

0 comments on commit c2e7aa1

Please sign in to comment.