Skip to content

Commit

Permalink
Added Mixcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed May 29, 2014
1 parent 614851c commit 8e27efb
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Media BB Codes for XenForo, imported from [s9e\TextFormatter](https://github.com
</tr>
<tr>
<td><code>gfycat</code></td>
<td>gfycat</td>
<td>Gfycat</td>
<td>http://gfycat.com/SereneIllfatedCapybara<br/>http://giant.gfycat.com/SereneIllfatedCapybara.gif</td>
</tr>
<tr>
Expand Down Expand Up @@ -164,6 +164,11 @@ Media BB Codes for XenForo, imported from [s9e\TextFormatter](https://github.com
<td>Metacafe</td>
<td>http://www.metacafe.com/watch/10785282/chocolate_treasure_chest_epic_meal_time/</td>
</tr>
<tr>
<td><code>mixcloud</code></td>
<td>Mixcloud</td>
<td>http://www.mixcloud.com/OneTakeTapes/timsch-one-take-tapes-2/<br/>http://i.mixcloud.com/CH9VU9</td>
</tr>
<tr>
<td><code>rdio</code></td>
<td>Rdio</td>
Expand Down
9 changes: 7 additions & 2 deletions build/addon.xml
Original file line number Diff line number Diff line change
@@ -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="20140527" version_string="201405270" 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="20140529" version_string="201405290" 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 @@ -91,7 +91,7 @@
!(?=.*?g(?:ettyimages\.(?:c(?:n|o(?:\.(?&gt;jp|uk)|m(?&gt;\.au)?))|d[ek]|es|fr|i[et]|nl|pt|[bs]e)|ty\.im)).*?gettyimages\.[.\w]+/detail(?=/).*?/(?'id'\d+)!</match_urls>
<embed_html><![CDATA[<!-- s9e_MediaBBCodes::renderGetty() -->]]></embed_html>
</site>
<site media_site_id="gfycat" site_title="gfycat" site_url="http://gfycat.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchGfycat">
<site media_site_id="gfycat" site_title="Gfycat" site_url="http://gfycat.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchGfycat">
<match_urls>!gfycat\.com/(?'id'\w+)!</match_urls>
<embed_html><![CDATA[<iframe width="{$width}" height="{$height}" src="http://gfycat.com/iframe/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
Expand Down Expand Up @@ -133,6 +133,11 @@
<match_urls>!metacafe\.com/watch/(?'id'[0-9]+)!</match_urls>
<embed_html><![CDATA[<iframe width="560" height="315" src="http://www.metacafe.com/embed/{$id}/" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="mixcloud" site_title="Mixcloud" site_url="http://www.mixcloud.com/" match_is_regex="1" supported="1" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchMixcloud">
<match_urls>@mixcloud\.com/(?!categories|tag)(?'id'[-\w]+/[^/&amp;]+)/@
@(?'id')//i\.mixcloud\.com/\w+$@</match_urls>
<embed_html><![CDATA[<iframe width="660" height="180" src="//www.mixcloud.com/widget/iframe/?feed=http%3A%2F%2Fwww.mixcloud.com%2F{$id}%2F&amp;hide_cover=1&amp;embed_type=widget_standard&amp;hide_tracklist=1" 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
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,19 @@ public static function matchKickstarter($url)
return self::match($url, $regexps, $scrapes);
}

public static function matchMixcloud($url)
{
$regexps = array('@mixcloud\\.com/(?!categories|tag)(?\'id\'[-\\w]+/[^/&]+)/@');
$scrapes = array(
array(
'match' => array('@//i\\.mixcloud\\.com/\\w+$@'),
'extract' => array('@link rel="canonical" href="https?://[^/]+/(?\'id\'[-\\w]+/[^/&]+)/@')
)
);

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

public static function matchRdio($url)
{
$regexps = array('!rd\\.io/./(?\'id\'\\w+)!');
Expand Down
10 changes: 8 additions & 2 deletions www/configure.html

Large diffs are not rendered by default.

0 comments on commit 8e27efb

Please sign in to comment.