get_access_token($oauth_token); $_SESSION['oauth_access_token'] = $token['oauth_token']; $_SESSION['oauth_access_token_secret'] = $token['oauth_token_secret']; } // Construct a fully authicated connection with SoundCloud. $soundcloud = new Soundcloud( $consumer_key, $consumer_secret, $_SESSION['oauth_access_token'], $_SESSION['oauth_access_token_secret'] ); // Get basic info about the authicated visitor. $me = $soundcloud->request('me'); $me = new SimpleXMLElement($me); $me = get_object_vars($me); $mytracks = $soundcloud->request('me/tracks/'); $mytracks = new SimpleXMLElement($mytracks); $mytracks = get_object_vars($mytracks); $x1 = $soundcloud->request('me/tracks/'); $x1 = new SimpleXMLElement($x1); $x2 = $soundcloud->request('me/tracks/'); $x2 = new SimpleXMLElement($x2); // If a track is submitted. if (isset($_POST['submit'])) { // We have to make sure it's a valid and supported format by SoundCloud. // Note that you also can include artwork for your tracks. Use the same // procedure as for the tracks. PNG, JPG, GIF allowed and a max size of 5MB. // The artwork field is called track[artwork_data]. $mimes = array( 'aac' => 'video/mp4', 'aiff' => 'audio/x-aiff', 'flac' => 'audio/flac', 'mp3' => 'audio/mpeg', 'ogg' => 'audio/ogg', 'wav' => 'audio/x-wav' ); $extension = explode('.', $_FILES['file']['name']); $extension = (isset($extension[count($extension) - 1])) ? $extension[count($extension) - 1] : NULL; $mime = (isset($mimes[$extension])) ? $mimes[$extension] : NULL; if (isset($mime)) { $tmp_file = $tmp_path . $_FILES['file']['name']; // Store the track temporary. if (move_uploaded_file($_FILES['file']['tmp_name'], $tmp_file)) { $post_data = array( 'track[title]' => stripslashes($_POST['title']), 'track[asset_data]' => realpath($tmp_file), 'track[sharing]' => 'private' ); if ($response = $soundcloud->upload_track($post_data, $mime)) { $response = new SimpleXMLElement($response); $response = get_object_vars($response); $message = 'Success! Your track has been uploaded!'; // Delete the temporary file. unlink(realpath($tmp_file)); } else { $message = 'Something went wrong while talking to SoundCloud, please try again.'; } } else { $message = 'Couldn\'t move file, make sure the temporary path is writable by the server.'; } } else { $message = 'SoundCloud support .mp3, .aiff, .wav, .flac, .aac, and .ogg files. Please select a different file.'; } } } else { // This is the first step in the "OAuth dance" where we ask the visitior to authicate himself. $soundcloud = new Soundcloud($consumer_key, $consumer_secret); $token = $soundcloud->get_request_token($callback_url) or die ("

Could not connect to soundcloud via the api


Email fresherplay about this error
Use the back button to go back") ; $_SESSION['oauth_request_token'] = $token['oauth_token']; $_SESSION['oauth_request_token_secret'] = $token['oauth_token_secret']; $login = $soundcloud->get_authorize_url($token['oauth_token']); } ?> Fresherplay
Import Music from Soundcloud
, ,



logout from soundcloud

You have .


"; foreach($x2 as $user){ echo ""; if (!isset($numbera)) {$number = "0";} $numbera = $numbera +1; echo ''.$user->title.'
'; $stream2 = $user->xpath('stream-url'); $perma2 = $user->xpath('permalink'); //print_r($perma2); //echo " $perma2[0] "; $stream3 = $stream2[0]; $perma3 = $perma2[0]; $stream4 = urlencode($stream3); $perma4 = urlencode($perma3); echo "
To play music on this website you need the Adobe Flash Plugin.
"; echo "
Add to Fresherplay "; } echo ""; //print_r($x2->tracks->track); //print $x2->tracks->track->permalink-XXurl . "\n"; /* foreach($x1->story as $story) { print("

" . $story->headline . "


"); print($story->description . "
_________________________
"); print($story->headline["date"] . "

"); } */ //print_r($x1); //echo "
"; //echo $x1->getName() . "
"; //echo "
"; foreach($x1->children() as $child) { //print_r($child); //echo $child->getName() . ": " . $child . "
"; //echo "$child[title]"; foreach($child->children() as $childx) { //echo ("$childx[0]" ); /* */ //echo $childx->getName() . ": " . $childx . "
"; } print($child[tracks][track]); //echo $child->getName() . ": " . $child . "
"; //echo "
"; } //$myvar = $mytracks->[track]->uri; //print_r($); ?>