Skip to content

Commit

Permalink
Fixing url encoding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerard committed Dec 5, 2012
1 parent 82e5379 commit 1eba676
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 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": {
Expand Down
12 changes: 6 additions & 6 deletions util/url_helper.js
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 1eba676

Please sign in to comment.