Giter Site home page Giter Site logo

node-hnsearch's Introduction

build status

node-hnsearch

node-hnsearch is a thin wrapper around the HNSearch REST API. Since node-hnsearch is such a thin wrapper, consulting the documentation provided by HNSearch is highly advised.

Installation

Download

$ npm install hnsearch

Or install via git clone:

$ git clone git://github.com/jharding/node-hnsearch.git
$ cd node-hnsearch
$ npm install

Require

var hnsearch = require('hnsearch');

API

hnsearch.submissions(query, cb)

hnsearch.comments(query, cb)

hnsearch.users(query, cb)

Use for querying submissions, comments, and users, respectively, against HNSearch's search API. query is the object containing the key-value pairs that the query string will be composed of. cb is the callback function that will be called when the response from HNSearch is received. It should support a (err, response) signature.

Details about the query fields and the response object can be found on the HNSearch API website.

Example

var hnsearch = require('hnsearch');

hnsearch.submissions({ q: 'javascript semicolons' }, function(err, response) {
  if (err) { process.exit(1); }

  console.log('Comments about semicolons and javascript!');
  response.results.forEach(function(result) { 
    console.log(result.item.text); 
  });
});

Testing

$ cd node-hnsearch
$ npm test

Issues

Found a bug? Create an issue on GitHub.

https://github.com/jharding/node-hnsearch/issues

Versioning

For transparency and insight into the release cycle, releases will be numbered with the follow format:

<major>.<minor>.<patch>

And constructed with the following guidelines:

  • Breaking backwards compatibility bumps the major
  • New additions without breaking backwards compatibility bumps the minor
  • Bug fixes and misc changes bump the patch

For more information on semantic versioning, please visit http://semver.org/.

License

Copyright (c) 2013 Jake Harding
Licensed under the MIT License.

node-hnsearch's People

Contributors

kevintcoughlin avatar jharding avatar

Stargazers

José Padilla avatar  avatar

Watchers

 avatar

Forkers

kevintcoughlin

node-hnsearch's Issues

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.