Created
November 26, 2012 08:37
-
-
Save mgng/4147218 to your computer and use it in GitHub Desktop.
soundcloud api で検索
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://soundcloud.com/buleus/meshuggah-bleed">Meshuggah - Bleed</a><br /> | |
<a href="http://soundcloud.com/isitreal/meshuggah-grin">Meshuggah grin</a><br /> | |
<a href="http://soundcloud.com/generaleramon/meshuggah-preset">Meshuggah Preset</a><br /> | |
<a href="http://soundcloud.com/godeyeam/meshuggah-obzen">Meshuggah - ObZen</a><br /> | |
<a href="http://soundcloud.com/metal/meshuggah-bleed">Meshuggah - Bleed</a><br /> | |
<a href="http://soundcloud.com/ruairiau/meshuggah-combustion">Meshuggah - Combustion</a><br /> | |
<a href="http://soundcloud.com/t-bag-2/meshuggah-clips">Meshuggah Clips</a><br /> | |
... | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '/path/to/php-soundcloud-master/Services/Soundcloud.php'; | |
$soundcloud = new Services_Soundcloud( 'YOUR_CLIENT_ID' ); | |
$soundcloud->setCurlOptions( array( | |
// via http://curl.haxx.se/ca/cacert.pem | |
CURLOPT_CAINFO => '/path/to/cacert.pem' | |
) ); | |
// via http://developers.soundcloud.com/docs/api/reference#tracks | |
$filters = array( | |
'q' => 'meshuggah', | |
//'genres' => 'death metal', | |
//'license' => 'all-rights-reserved', | |
); | |
$tracks = json_decode( $soundcloud->get( 'tracks', $filters ) ); | |
foreach( $tracks as $track ) { | |
echo "<a href=\"{$track->permalink_url}\">{$track->title}</a><br />\n"; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment