Last active
August 29, 2015 14:06
-
-
Save agreen757/451d93f7e528af036c92 to your computer and use it in GitHub Desktop.
Simple search using SC API
This file contains hidden or 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
exports.search = function(query,cb){ | |
var request = require('request'), | |
clientid = "dd", | |
secret = "dd", | |
sc_redirect_uri = "dd", | |
sc = require('soundclouder'); | |
var search = query.split(" ").join("+") | |
//this is working | |
request.get('https://api.soundcloud.com/tracks.json?q='+search+'&client_id='+clientid, function(err,res){ | |
if(err){console.log(err)} | |
//console.log(res.body.length); | |
var parsed = JSON.parse(res.body); | |
for(i in parsed){ | |
console.log(parsed[i].id+" "+parsed[i].title) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment