Is it possible to use PCRE to create a match url for this? http://diversifiedsound.podomatic.com/entry/2011-12-01T16_15_09-08_00.
Desperately seeking an option for this too as I have a DJ site that uses Pod-O-Matic heavily. What is the actual source file the parses the {$id} ? Maybe I can hack to accept {$idx} ?? Should we request this as a feature or has it already been requested?
<?php
//Template courtesy of Jake Bunce
class MediaSites_Podomatic
{
public static function buildEmbed($mediaKey, array $site)
{
// CAPTURE WEB PAGE
$pageHtml = file_get_contents( 'http://' . $mediaKey );
// ISOLATE THE PARAMS THAT ARE NEEDED FROM THE PAGE
if(preg_match('#<meta\scontent=\'http\://(?P<subd>[a-z0-9-_.]+)\.podomatic\.com/entry/(?P<pentry>[a-z0-9-_]+)\'\sproperty=\'og:url\'#si', $pageHtml, $match))
{
// DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLES __MEDIAKEY1__ and __MEDIAKEY2__
$embedHtml = '<iframe height="85px" width="440px" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://__MEDIAKEY1__.podomatic.com/embed/frame/posting/__MEDIAKEY2__?json_url=http%3A%2F%2F__MEDIAKEY1__.podomatic.com%2Fentry%2Fembed_params%2F__MEDIAKEY2__%3Fcolor%3D43bee7%26autoPlay%3Dfalse%26width%3D440%26height%3D85"></iframe>';
$finalHtml = str_replace(array('__MEDIAKEY1__', '__MEDIAKEY2__'), array($match['subd'], $match['pentry']), $embedHtml);
return $finalHtml;
}
// RETURN NOTHING IF NO MATCH
else return '';
}
}
PM me one of your playlist's full embed code with the following options set on that popup windowCan you try to add playlist.com?
View attachment 22644
Hacking away wont be needed
___________________________
This media site will be added to THIS addon upon the next update.
Download and extract the attached zip and upload the library folder to your forum root.
Add a new media site
Media Site ID: podomatic
________________________________________
Site Title: Podomatic
________________________________________
Site URL: http://www.podomatic.com/
________________________________________
Match URLs: #(?P<id>http://[a-z0-9-_.]+\.podomatic\.com/entry/[0-9-_]+T[0-9-_]+)#si
________________________________________
Embed HTML: <See HTML Callback>
________________________________________
Regular Expression Matching: Use 'Match URLs' as PCRE regular expressions [ Checked ]
________________________________________
Embed HTML Callback: MediaSites_Podomatic::buildEmbed
For reference this is the embed callback:
PHP:<?php //Template courtesy of Jake Bunce class MediaSites_Podomatic { public static function buildEmbed($mediaKey, array $site) { // CAPTURE WEB PAGE $pageHtml = file_get_contents( $mediaKey ); // ISOLATE THE PARAMS THAT ARE NEEDED FROM THE PAGE if(preg_match('#<param name=\'movie\' value=\'http://(?P<bbmovie>[a-z0-9-_.]+\.com/swf/joeplayer_v18c\.swf)\'></param>\s<param\sname=\'flashvars\'\svalue=\'(?P<bbflashvars>[a-z0-9-=&%._]+)%3Fauto#si', $pageHtml, $match)) { // DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLES __MEDIAKEY1__ and __MEDIAKEY2__ $embedHtml = '<object width="40" height="85"> <param name="movie" value="http://__MEDIAKEY1__"></param> <param name="flashvars" value="__MEDIAKEY2__%3Fcolor%3D43bee7%26autoPlay%3Dfalse%26width%3D440%26height%3D85"></param> <param name="flashvars" value="__MEDIAKEY2__%3Fcolor%3D43bee7%26autoPlay%3Dfalse%26width%3D440%26height%3D85"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="http://__MEDIAKEY1__" flashvars="__MEDIAKEY2__%3Fcolor%3D43bee7%26autoPlay%3Dfalse%26width%3D440%26height%3D85" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="440" height="85"> </embed> </object>'; // MAKE THE REPLACEMENTS $finalHtml = str_replace(array('__MEDIAKEY1__', '__MEDIAKEY2__'), array($match['bbmovie'], $match['bbflashvars']), $embedHtml); // RETURN THE FINISHED HTML return $finalHtml; } // RETURN NOTHING IF NO MATCH return ''; } }
<iframe id="NBC Video Widget" width="512" height="347" src="http://www.nbc.com/assets/video/widget/widget.html?vid={$id}" frameborder="0"></iframe>
I got soundcloud working with 1.1:
Hi Jake,
Do you know how to get soundcloud sets working?
Thanks!![]()
#http://soundcloud\.com/(?P<id>[\-a-z0-9_]+/[\-a-z0-9_]+/[\-a-z0-9_]+/)$#siU
<?php
class MediaSites_Soundcloud
{
public static function buildEmbed($mediaKey, array $site)
{
$pageHtml = file_get_contents('http://soundcloud.com/' . $mediaKey );
if(preg_match('#<meta.+player.swf\?url=.+tracks%2F(?P<scid>[0-9]+)#si', $pageHtml, $match))
{
$embedHtml = '<iframe width="100%" height="166" class="html5player" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F__MEDIAKEY__&show_artwork=true"></iframe>';
$finalHtml = str_replace('__MEDIAKEY__', $match['scid'], $embedHtml);
return $finalHtml;
}
elseif(preg_match('#<meta.+player.swf\?url=.+playlists%2F(?P<scid>[0-9]+)#si', $pageHtml, $match))
{
$embedHtml = '<iframe width="100%" height="450" class="html5player" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F__MEDIAKEY__&show_artwork=true"></iframe>';
$finalHtml = str_replace('__MEDIAKEY__', $match['scid'], $embedHtml);
return $finalHtml;
}
elseif(preg_match('#<meta.+player.swf\?url=.+users%2F(?P<scid>[0-9]+)#si', $pageHtml, $match))
{
$embedHtml = '<iframe width="100%" height="450" class="html5player" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fusers%2F__MEDIAKEY__&show_artwork=true"></iframe>';
$finalHtml = str_replace('__MEDIAKEY__', $match['scid'], $embedHtml);
return $finalHtml;
}
else return '<a href="http://soundcloud.com/' . $mediaKey . '">http://soundcloud.com/' . $mediaKey . '</a>';
}
}
Media Site ID: podomatic
________________________________________
Site Title: Podomatic
________________________________________
Site URL: http://www.podomatic.com/
________________________________________
Match URLs: #(?P<id>http://[a-z0-9-_.]+\.podomatic\.com/entry/[0-9-_]+T[0-9-_]+)#si
________________________________________
Embed HTML: <See HTML Callback>
________________________________________
Regular Expression Matching: Use 'Match URLs' as PCRE regular expressions [ Checked ]
________________________________________
Embed HTML Callback: MediaSites_Podomatic::buildEmbed
For reference this is the embed callback:
PHP:<?php //Template courtesy of Jake Bunce class MediaSites_Podomatic { public static function buildEmbed($mediaKey, array $site) { // CAPTURE WEB PAGE $pageHtml = file_get_contents( $mediaKey ); // ISOLATE THE PARAMS THAT ARE NEEDED FROM THE PAGE if(preg_match('#<param name=\'movie\' value=\'http://(?P<bbmovie>[a-z0-9-_.]+\.com/swf/joeplayer_v18c\.swf)\'></param>\s<param\sname=\'flashvars\'\svalue=\'(?P<bbflashvars>[a-z0-9-=&%._]+)%3Fauto#si', $pageHtml, $match)) { // DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLES __MEDIAKEY1__ and __MEDIAKEY2__ $embedHtml = '<object width="40" height="85"> <param name="movie" value="http://__MEDIAKEY1__"></param> <param name="flashvars" value="__MEDIAKEY2__%3Fcolor%3D43bee7%26autoPlay%3Dfalse%26width%3D440%26height%3D85"></param> <param name="flashvars" value="__MEDIAKEY2__%3Fcolor%3D43bee7%26autoPlay%3Dfalse%26width%3D440%26height%3D85"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="http://__MEDIAKEY1__" flashvars="__MEDIAKEY2__%3Fcolor%3D43bee7%26autoPlay%3Dfalse%26width%3D440%26height%3D85" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="440" height="85"> </embed> </object>'; // MAKE THE REPLACEMENTS $finalHtml = str_replace(array('__MEDIAKEY1__', '__MEDIAKEY2__'), array($match['bbmovie'], $match['bbflashvars']), $embedHtml); // RETURN THE FINISHED HTML return $finalHtml; } // RETURN NOTHING IF NO MATCH return ''; } }
if(preg_match('#<param name=\'movie\' value=\'http://(?P<bbmovie>[a-z0-9-_.]+\.com/swf/joeplayer_v18c\.swf)\'></param>\s<param\sname=\'flashvars\'\svalue=\'(?P<bbflashvars>[a-z0-9-=&%._]+)%3Fauto#si', $pageHtml, $match))
<?php
//Template courtesy of Jake Bunce
class MediaSites_Podomatic
{
public static function buildEmbed($mediaKey, array $site)
{
// CAPTURE WEB PAGE
$id2 = substr($mediaKey, -25);
$replaceValues = array("http://" , ".podomatic.com/entry/" . $id2);
$id1 = str_replace($replaceValues, "", $mediaKey);
//$pageHtml = file_get_contents( $mediaKey );
$pageURL = 'http://'.$id1.'.podomatic.com/embed/frame/posting/'.$id2.'?json_url=http%3A%2F%2F'.$id1.'.podomatic.com%2Fentry%2Fembed_params%2F'.$id2.'%3FautoPlay%3Dtrue%26facebook%3Dfalse%26height%3D85%26minicast%3Dfalse%26permalink%3Dtrue%26rtmp%3D1%26width%3D580';
$pageHtml = file_get_contents($pageURL);
// ISOLATE THE PARAMS THAT ARE NEEDED FROM THE PAGE
//if(preg_match('#<param name=\'movie\' value=\'http://(?P<bbmovie>[a-z0-9-_.]+\.com/swf/joeplayer_v18c\.swf)\'></param>\s<param\sname=\'flashvars\'\svalue=\'(?P<bbflashvars>[a-z0-9-=&%._]+)%3Fauto#si', $pageHtml, $match))
if(preg_match('#<param name=\'flashvars\' value=\'(?P<bbflashvars>[a-z0-9-=&%._]+)#si', $pageHtml, $match))
{
// DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLES __MEDIAKEY1__ and __MEDIAKEY2__
$embedHtml = '<object width="580" height="85">
<param name="wmode" value="transparent" />
<param name="movie" value="http://'.$id1.'.podomatic.com/swf/joeplayer_v18c.swf"></param>
<param name="flashvars" value="minicast=false&jsonLocation=http%3A%2F%2F'.$id1.'.podomatic.com%2Fentry%2Fembed_params%2F'.$id2.'%3FautoPlay%3Dfalse%26facebook%3Dfalse%26height%3D85%26minicast%3Dfalse%26permalink%3Dtrue%26rtmp%3D1%26width%3D580"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://'.$id1.'.podomatic.com/swf/joeplayer_v18c.swf" flashvars="minicast=false&jsonLocation=http%3A%2F%2F'.$id1.'.podomatic.com%2Fentry%2Fembed_params%2F'.$id2.'%3FautoPlay%3Dfalse%26facebook%3Dfalse%26height%3D85%26minicast%3Dfalse%26permalink%3Dtrue%26rtmp%3D1%26width%3D580" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="580" height="85">
</embed>
</object>';
// MAKE THE REPLACEMENTS
$finalHtml = str_replace(array('__MEDIAKEY1__', '__MEDIAKEY2__'), array($match['bbmovie'], $match['bbflashvars']), $embedHtml);
// RETURN THE FINISHED HTML
return $finalHtml;
}
// RETURN NOTHING IF NO MATCH
return '';
}
}
preg_match_all #(?P<id>http://[a-z0-9-_.]+\.podomatic\.com/entry/[0-9-_]+T[0-9-_]+)#si
[0]=> array
[0]=>http://bgchck1960.podomatic.com/entry/2011-12-16T16_59_50-08_00
[id]=> array
[0]=>http://bgchck1960.podomatic.com/entry/2011-12-16T16_59_50-08_00
[1]=> array
[0]=>http://bgchck1960.podomatic.com/entry/2011-12-16T16_59_50-08_00
We use essential cookies to make this site work, and optional cookies to enhance your experience.