Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ####################################
- # Dev: Atmoner
- # http://atmoner.com
- ####################################
- class soundCloud{
- # Var
- private $soundCloudServer = "http://media.soundcloud.com/stream/";
- public function getMp3($uri) {
- # code...
- $fullPageSource = file($uri);
- $fullPageSource = implode("", $fullPageSource);
- $streamURIPos = strpos($fullPageSource, $this->soundCloudServer, 0);
- if(!$streamURIPos)
- return false;
- $streamURIArray = substr($fullPageSource, $streamURIPos);
- $streamURIArray = explode('"', $streamURIArray);
- $streamURI = $streamURIArray[0];
- unset($streamURIArray);
- if(!strstr($streamURI, $this->soundCloudServer))
- return false;
- return $streamURI;
- }
- public function exploserChaine( $chaine ){
- # code...
- $to = '.,;:!?/&"';
- $from = ' ';
- $chaine = strtr( $chaine, $to, $from );
- $tabTemp = explode( ' ', $chaine );
- strip_tags($tabTemp);
- foreach( $tabTemp as $k => $v ){
- if($v != NULL){
- if(preg_match('#(.*){1}(\')#', $v, $matches)){
- $v = substr($v, 2);
- }
- $tabChaine[] = $v;
- }
- }
- return $tabChaine;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment