SoundCloud BBcode Media Site [Deleted]

like ebay still embeds sometimes but it doesnt have a callback file in that folder
Ebay doesn't use a callback (not all bbcodes use a callback), also some ebay links don't embed because of specific changes in the url scheme they use.

Please (in the mediasites pack thread) paste links to ebay items that are not embedding so I can have a place to start more testing.
 
Ok so I have tested it with another track besides the link you sent me...it embeds...but the one you gave me doesn't and if I check it with straight php outside of xenforo your link throws a 403 error (forbidden)...hmmm


I searched google and found someone who uploaded a test clip which is set to private...this was that link:
http://soundcloud.com/johantest/tunelab-test-track-2/s-o5JRu
you will see that this private track embeds just fine... I wonder if there is any other settings on soundcloud blocking that.
 
Ok so I have tested it with another track besides the link you sent me...it embeds...but the one you gave me doesn't and if I check it with straight php outside of xenforo your link throws a 403 error (forbidden)...hmmm
That's really weird. I could get it to work if it included the regex portion of the BBCode would keep the /secret-token portion at the end of the URL when it put it in the [media] tag.

#(?P<id>soundcloud\.com/(([a-z0-9-_]+/[a-z0-9-_]+/[a-z0-9-_]+)|([a-z0-9-_]+/[a-z0-9-_]+)))#si
 
That's really weird. I could get it to work if it included the regex portion of the BBCode would keep the /secret-token portion at the end of the URL when it put it in the [media] tag.

#(?P<id>soundcloud\.com/(([a-z0-9-_]+/[a-z0-9-_]+/[a-z0-9-_]+)|([a-z0-9-_]+/[a-z0-9-_]+)))#si
It does not strip it....here is what a private track looks like when embedded....

[media=soundcloud]soundcloud.com/johantest/tunelab-test-track-1/s-GirVG[/media]


http://soundcloud.com/johantest/tunelab-test-track-2/s-o5JRu​
match expression
#(?P<id>soundcloud\.com/(([a-z0-9-_]+/[a-z0-9-_]+/[a-z0-9-_]+)|([a-z0-9-_]+/[a-z0-9-_]+)))#si​
matches
[id]=> array​
  • [0]=>soundcloud.com/johantest/tunelab-test-track-2/s-o5JRu
 
heh...the link you sent me in that convo didnt have sets in it :-) I didn't even think of that....

try this for the regex:
#(?P<id>soundcloud\.com/(([a-z0-9-_]+/[a-z0-9-_]+/[a-z0-9-_]+)|([a-z0-9-_]+/[a-z0-9-_]+))(/[a-z0-9-]+)?)#si
 
heh...the link you sent me in that convo didnt have sets in it :) I didn't even think of that....

try this for the regex:
#(?P<id>soundcloud\.com/(([a-z0-9-_]+/[a-z0-9-_]+/[a-z0-9-_]+)|([a-z0-9-_]+/[a-z0-9-_]+))(/[a-z0-9-]+)?)#si
There we go.

Yeah, SC has a lot of weird options. Hah. Thank you! Fixed it all up.

Only other thing I did was add a cache on the main Soundcloud.php file -- since I didn't want to hit the soundcloud page every single time -- it fixed up any delay on subsequent loads of the page.
 
mind showing me that?...it might make sense to add it in an update once I can see how you did that
 
mind showing me that?...it might make sense to add it in an update once I can see how you did that

PHP:
$cachefile = md5($mediaKey);
$cache_path = DIR.'/internal_data/page_cache/curl_cache/'.$cachefile;
$cache_exists = is_readable($cache_path);
if($cache_exists)
{
$datas= file_get_contents($cache_path);
}
else
{
$datas = file_get_contents($scUrl);
if($datas)
{
file_put_contents($cache_path, $datas);
}
}

Basically just putting the returned information from the file_get_contents into a local file. Then using that instead if it exists. It would probably be better to do it with a date and have it refresh after X amount of days ... but this is the basics.
 
It must be server specific as it does the same on mine.
I have no idea why though.
 
This was my old code, works for like half of the soundcloud urls and didn't have a callback file that I can see...

Media Site ID:
soundcloud
Site Title:
SoundCloud
Site URL:
http://soundcloud.com/
Match URLs:
Code:
#http://soundcloud\.com/(?P<id>[\-a-z0-9_]+/[\-a-z0-9_]+)$#siU


Embed HTML:
Code:
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F{$id}&amp;g=bb"></param>
<param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F{$id}&amp;g=bb" type="application/x-shockwave-flash" width="100%"></embed>
</object>
Use 'Match URLs' as PCRE regular expressions
 
Does this require any other addons or any steps after installing the addon?

I installed it on our site and it's integrating itself nicely into the media sites menu in the admin menu and it "recognizes" the soundcloud links but then only shows them as
Code:
[media=soundcloud]soundcloud.com/themagician/magic-tape-thirty-three[/media]

Any ideas?
 
Top Bottom