Created
May 28, 2012 05:47
-
-
Save connor/2817498 to your computer and use it in GitHub Desktop.
search method implementation with encodeURIComponent
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
var request = require('request') | |
exports.search = function( query, callback ) { | |
request("http://domai.nr/api/json/search?q=" + encodeURIComponent(query), function(err, response, body) { | |
callback( JSON.parse(body) ) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment