Git Product home page Git Product logo

node-angellist's Introduction

node-angellist: Easy wrapper around the AngelList API

This module is designed to be an easy-to-use wrapper around the AngelList API. This module is designed to be used with node.js.

Install

  npm install angellist

Or from source:

  git clone git://github.com/rgerard/node-angellist.git
  cd node-angellist
  npm install

Simple Examples

var angel = require('angellist');

// Init the object with your API key
angel.init(clientID, clientSecret);

// Search for a company name
angel.search('pickmoto', function(error, results) {
 if (!error) {
    console.log(results) // Print the search results
  }
});

Documentation

Please refer to the AngelList API documentation for more detail on their API.

AngelList API

### init(clientID, clientSecret)

Inits the object with your client data;

Arguments

  • clientID - Your client ID
  • clientSecret - Your client secret

Example

// Init an AngelList object
var angel = require('angellist');
angel.init(clientID, clientSecret);

### getAuthUrl()

Returns the URL needed to start the authentication process.

Example

// Redirect the user to the auth URL
var url = angel.getAuthUrl();
res.redirect(url);

### requestAccessToken(code, callback)

Requests an access token for a user who has authenticated your application

Arguments

  • code - Returned from AngelList after the user has authenticated your app
  • callback(err, body) - A callback which is called after the API call has returned, or an error has occurred.

Example

// Fetch the access token
angel.requestAccessToken(req.query['code'], function(err, body) {
 if (!error) {
    // Set the access token
    angel.setAccessToken(body.access_token);
  }
});

### setAccessToken(token)

Stores the access token returned from AngelList

Arguments

  • token - Token to save

Example

// Fetch the access token
angel.requestAccessToken(req.query['code'], function(err, body) {
 if (!error) {
    // Set the access token
    angel.setAccessToken(body.access_token);
  }
});

### getMe(callback)

Returns the information about the logged-in user

Arguments

  • callback(err, body) - A callback which is called after the API call has returned, or an error has occurred.

Example

// Fetch the posts for a company/person
angel.getMe(function(err, user) {
 if (!error) {
    console.log(user);
  }
});

### search(query, callback)

Returns the search results from a query.

Arguments

  • query - The person or company to search for
  • callback(err, body) - A callback which is called after the API call has returned, or an error has occurred.

Example

// Search for a person or company
angel.search('pickmoto', function(err, results) {
 if (!error) {
    console.log(results);
  }
});

### getUserById(angelID, callback)

Returns the information about a user by their AngelList ID.

Arguments

  • angelID - The AngelList ID of the person to get information for.
  • callback(err, body) - A callback which is called after the API call has returned, or an error has occurred.

Example

// Search for a person or company
angel.getUserById(77, function(err, user) {
 if (!error) {
    console.log(user);
  }
});

node-angellist's People

Contributors

rgerard avatar teemow avatar treygriffith avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.