Commit 0f18a49e by Alex MacCaw

use clearbit.com

parent 5ac7b823
clearbit-node [![Build Status](https://travis-ci.org/bendrucker/clearbit-node.svg?branch=master)](https://travis-ci.org/bendrucker/clearbit-node) [![Code Climate](https://codeclimate.com/github/bendrucker/clearbit-node/badges/gpa.svg)](https://codeclimate.com/github/bendrucker/clearbit-node) [![Test Coverage](https://codeclimate.com/github/bendrucker/clearbit-node/badges/coverage.svg)](https://codeclimate.com/github/bendrucker/clearbit-node) clearbit-node [![Build Status](https://travis-ci.org/bendrucker/clearbit-node.svg?branch=master)](https://travis-ci.org/bendrucker/clearbit-node) [![Code Climate](https://codeclimate.com/github/bendrucker/clearbit-node/badges/gpa.svg)](https://codeclimate.com/github/bendrucker/clearbit-node) [![Test Coverage](https://codeclimate.com/github/bendrucker/clearbit-node/badges/coverage.svg)](https://codeclimate.com/github/bendrucker/clearbit-node)
============= =============
Node library for querying the [Clearbit](https://clearbit.co) business intelligence APIs. Currently supports: Node library for querying the [Clearbit](https://clearbit.com) business intelligence APIs. Currently supports:
* [Person API](https://clearbit.co/docs#person-api) * [Person API](https://clearbit.com/docs#person-api)
* [Company API](https://clearbit.co/docs#company-api) * [Company API](https://clearbit.com/docs#company-api)
## Setup ## Setup
```bash ```bash
...@@ -25,7 +25,7 @@ var clearbit = new Client({key: 'api_key'}); ...@@ -25,7 +25,7 @@ var clearbit = new Client({key: 'api_key'});
* `email` *String*: The email address to look up **(required)** * `email` *String*: The email address to look up **(required)**
* `webhook_id` *String*: Custom identifier for the webhook request * `webhook_id` *String*: Custom identifier for the webhook request
* `subscribe` *Boolean*: Set to `true` to subscribe to the changes * `subscribe` *Boolean*: Set to `true` to subscribe to the changes
* `stream` *Boolean*: Set to `true` to use the [streaming API](https://clearbit.co/docs?shell#streaming) instead of webhooks * `stream` *Boolean*: Set to `true` to use the [streaming API](https://clearbit.com/docs?shell#streaming) instead of webhooks
```js ```js
var Person = clearbit.Person; var Person = clearbit.Person;
...@@ -49,7 +49,7 @@ Person.find({email: 'email@domain.com'}) ...@@ -49,7 +49,7 @@ Person.find({email: 'email@domain.com'})
#### `Company.find(options)` -> `Promise` #### `Company.find(options)` -> `Promise`
* `domain` *String*: The company domain to look up **(required)** * `domain` *String*: The company domain to look up **(required)**
* `webhook_id` *String*: Custom identifier for the webhook request * `webhook_id` *String*: Custom identifier for the webhook request
* `stream` *Boolean*: Set to `true` to use the [streaming API](https://clearbit.co/docs?shell#streaming) instead of webhooks * `stream` *Boolean*: Set to `true` to use the [streaming API](https://clearbit.com/docs?shell#streaming) instead of webhooks
```js ```js
var Company = clearbit.Company; var Company = clearbit.Company;
......
...@@ -20,7 +20,7 @@ function ClearbitClient (config) { ...@@ -20,7 +20,7 @@ function ClearbitClient (config) {
this.PersonCompany = require('./person_company')(this); this.PersonCompany = require('./person_company')(this);
} }
var base = 'https://%s%s.clearbit.co/v%s'; var base = 'https://%s%s.clearbit.com/v%s';
ClearbitClient.prototype.base = function (options) { ClearbitClient.prototype.base = function (options) {
options = _.defaults(options, { options = _.defaults(options, {
version: '1', version: '1',
......
...@@ -45,7 +45,7 @@ describe('Client', function () { ...@@ -45,7 +45,7 @@ describe('Client', function () {
expect(client.base({ expect(client.base({
api: 'person' api: 'person'
})) }))
.to.equal('https://person.clearbit.co/v1'); .to.equal('https://person.clearbit.com/v1');
}); });
it('can generate a streaming base', function () { it('can generate a streaming base', function () {
...@@ -53,7 +53,7 @@ describe('Client', function () { ...@@ -53,7 +53,7 @@ describe('Client', function () {
api: 'person', api: 'person',
stream: true stream: true
})) }))
.to.equal('https://person-stream.clearbit.co/v1'); .to.equal('https://person-stream.clearbit.com/v1');
}); });
it('can set a custom version', function () { it('can set a custom version', function () {
...@@ -61,7 +61,7 @@ describe('Client', function () { ...@@ -61,7 +61,7 @@ describe('Client', function () {
api: 'person', api: 'person',
version: '2' version: '2'
})) }))
.to.equal('https://person.clearbit.co/v2'); .to.equal('https://person.clearbit.com/v2');
}); });
}); });
...@@ -70,7 +70,7 @@ describe('Client', function () { ...@@ -70,7 +70,7 @@ describe('Client', function () {
var mock; var mock;
before(function () { before(function () {
mock = nock('https://person.clearbit.co'); mock = nock('https://person.clearbit.com');
}); });
after(nock.cleanAll); after(nock.cleanAll);
afterEach(function () { afterEach(function () {
......
...@@ -8,7 +8,7 @@ describe('Company', function () { ...@@ -8,7 +8,7 @@ describe('Company', function () {
var mock; var mock;
before(function () { before(function () {
mock = nock('https://company.clearbit.co'); mock = nock('https://company.clearbit.com');
}); });
after(nock.cleanAll); after(nock.cleanAll);
afterEach(function () { afterEach(function () {
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
"email": "alex@alexmaccaw.com", "email": "alex@alexmaccaw.com",
"gender": "male", "gender": "male",
"location": "San Francisco", "location": "San Francisco",
"bio": "O'Reilly author, software engineer & traveller. Founder of https://clearbit.co", "bio": "O'Reilly author, software engineer & traveller. Founder of https://clearbit.com",
"site": "http://alexmaccaw.com", "site": "http://alexmaccaw.com",
"avatar": "https://pbs.twimg.com/profile_images/1826201101/297606_10150904890650705_570400704_21211347_1883468370_n.jpeg", "avatar": "https://pbs.twimg.com/profile_images/1826201101/297606_10150904890650705_570400704_21211347_1883468370_n.jpeg",
"employment": { "employment": {
"name": "Clearbit", "name": "Clearbit",
"title": "CEO", "title": "CEO",
"domain": "clearbit.co" "domain": "clearbit.com"
}, },
"facebook": { "facebook": {
"handle": "amaccaw" "handle": "amaccaw"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"twitter": { "twitter": {
"handle": "maccaw", "handle": "maccaw",
"id": 2006261, "id": 2006261,
"bio": "O'Reilly author, software engineer & traveller. Founder of https://clearbit.co", "bio": "O'Reilly author, software engineer & traveller. Founder of https://clearbit.com",
"followers": 14993, "followers": 14993,
"following": 1645, "following": 1645,
"location": "San Francisco", "location": "San Francisco",
......
...@@ -8,7 +8,7 @@ describe('Person', function () { ...@@ -8,7 +8,7 @@ describe('Person', function () {
var mock; var mock;
before(function () { before(function () {
mock = nock('https://person.clearbit.co'); mock = nock('https://person.clearbit.com');
}); });
after(nock.cleanAll); after(nock.cleanAll);
afterEach(function () { afterEach(function () {
......
...@@ -8,7 +8,7 @@ describe('PersonCompany', function () { ...@@ -8,7 +8,7 @@ describe('PersonCompany', function () {
var mock; var mock;
before(function () { before(function () {
mock = nock('https://person.clearbit.co'); mock = nock('https://person.clearbit.com');
}); });
after(nock.cleanAll); after(nock.cleanAll);
afterEach(function () { afterEach(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment