From 1eba6766b40941f4cf477818b7f71946d7bc2797 Mon Sep 17 00:00:00 2001 From: rgerard Date: Wed, 5 Dec 2012 01:01:53 -0800 Subject: [PATCH] Fixing url encoding issue --- package.json | 2 +- util/url_helper.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index bcf0064..a5a16b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crunchbase", - "version": "0.1.1", + "version": "0.1.2", "description": "Node module that wraps the Crunchbase API", "main": "index.js", "scripts": { diff --git a/util/url_helper.js b/util/url_helper.js index ba3deca..8cee98a 100644 --- a/util/url_helper.js +++ b/util/url_helper.js @@ -4,9 +4,9 @@ function getEntityUrl(entityType, name) { // URL should look like: http://api.crunchbase.com/v/1/Entity/Name.js return 'http://api.crunchbase.com/v/1/' - + entityType + + encodeURIComponent(entityType) + '/' - + name + + encodeURIComponent(name) + '.js?api_key=' + config.apikey; } @@ -24,7 +24,7 @@ function searchUrl(query) { // URL should look like: http://api.crunchbase.com/v/1/search.js return 'http://api.crunchbase.com/v/1/search.js?query=' - + query + + encodeURIComponent(query) + '&api_key=' + config.apikey; } @@ -35,11 +35,11 @@ function getPostsUrl(entityType, name, firstName, lastName) { return 'http://api.crunchbase.com/v/1/' + entityType + '/posts?name=' - + name + + encodeURIComponent(name) + '&first_name=' - + firstName + + encodeURIComponent(firstName) + '&last_name=' - + lastName + + encodeURIComponent(lastName) + '&api_key=' + config.apikey; }