Hello everybody. Just wanted to showcase this little thing I cooked up these last 10 minutes.
It is a PHP class that yields a function that can get the MP3 stream of a song from it's SoundCloud URL.
Example to use:PHP Code:<?php
/*
* SoundCloud Download Class
* Copyright 2009, Kimmy Andersson. All Rights Reserved.
* Created by Kimmy Andersson.
*
* Terms:
* You are not allowed to use this for commercial use.
* You are not allowed to claim this as you own, or as anyone else's except mine.
* You are allowed to create deravative works as long as you contact and credit me.
* This is for educational purposes only, I do not stand responsible if you get in trouble by using this.
* This script is not allowed to be redistributed, sold or re-uploaded without asking me.
*
*/
class SOUNDCLOUD
{
function __construct()
{
return;
}
private $soundcloudStreamServer = "http://media.soundcloud.com/stream/";
public function getMP3DownloadFromURI( $uri )
{
$fullPageSource = file($uri);
$fullPageSource = implode("", $fullPageSource);
$streamURIPos = strpos($fullPageSource, $this->soundcloudStreamServer, 0);
if(!$streamURIPos)
return false;
$streamURIArray = substr($fullPageSource, $streamURIPos);
$streamURIArray = explode('"', $streamURIArray);
$streamURI = $streamURIArray[0];
unset($streamURIArray);
if(!strstr($streamURI, $this->soundcloudStreamServer))
return false;
return $streamURI;
}
}
?>
Thank you for reading and enjoy.PHP Code:<?php
include("class/class.soundcloud.php");
$sCloud = new SOUNDCLOUD();
$link = $sCloud->getMP3DownloadFromURI("http://soundcloud.com/user5970490/adam-nickey-callista-original-mix");
if(!$link)
echo("No");
else
echo($link);
?>


Reply With Quote![[PHP]SoundCloud Download Class](http://ragezone.com/hyper728.png)


