Giter Site home page Giter Site logo

rasata / node-calais Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mcantelon/node-calais

1.0 3.0 0.0 289 KB

Node.js module/CLI tool for semantic analysis of text using the OpenCalais web service.

License: MIT License

Makefile 0.98% JavaScript 95.69% CoffeeScript 3.32%

node-calais's Introduction

node-calais

node-calais allows semantic analysis of text using the Calais web service.

Install

Install using npm: $ npm install calais

Usage

var calais = new Calais('<YOUR API KEY>')
calais.set('content', 'The Federal Reserve is the enemy of Ron Paul.')
calais.fetch(function(err, result) {
  // do something with result
})

Example

Run quick example: $ node example.js

Options

In addition to using the "set" method, a hash of option settings can be passed as the second argument during intialization. For example:

var calais = new Calais('<YOUR API KEY>', {'cleanResult': false})

By default, node-calais will return fetched results as a Javascript object. Alternatively, the Calais standard "outputFormat" input parameter can be set to standard output formats (see Calais documentation).

Any standard Calais input parameter can be specified as an option, as well as the 'cleanResult' parameter which will return a simplified Javascript object if "outputFormat" hasn't been set to something other than the default ('object').

CLI Tool

The library also comes with a CLI tool for sending text files to Calais for analysis.

Example:

calais some_key_file -k my_api_key

If you use the CLI tool regularly, you can specify a default API key by setting the api_key property in an .ini file at $HOME/.calais.

Test

Run tests: $ expresso test/calais.test.js

Tested with node.js v0.11.13

Contributors

Mike Cantelon (github: mcantelon)

D. Charbonnier (github: dcharbonnier)

Dirk Gorissen (github: dgorissen)

Harry Guillermo (github: hguillermo)

(c) 2010-2014 Mike Cantelon, MIT license

node-calais's People

Contributors

mcantelon avatar dcharbonnier avatar dgorissen avatar hguillermo avatar blakmatrix avatar jfhbrook avatar

Stargazers

Zo-Hasina Rasatavohary avatar

Watchers

Zo-Hasina Rasatavohary avatar James Cloos 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.