Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hackerfire

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hackerfire

A node module to wrap around the Hacker News Firebase API

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

hackerfire

Simple Node module for the Hacker News Firebase API

Installation:

npm install hackerfire

Usage:

Get Top Stories:

var hackerfire = require('hackerfire');

hackerfire.getTopStories().then(function(response) {
  console.log(response);
});

Get User:

var user = hackerfire.getUserById('pg');

user.on('value', function(response) {
  console.log(response.val());
}, function(error) {
  console.log('retrieval failed: ' + error.code);
});

var users = hackerfire.getUserById([ 'pg', 'foobar' ]);

for(var i = 0; i < users.length; i++) {
  users[i].on('value', function(response) {
    console.log(response.val());
  }, function(error) {
    console.log('retrieval failed: ' + error.code);
  });
}

Get Item:

var item = hackerfire.getItem( '8265435' );

for(var i = 0; i < item.length; i++) {
  item.on('value', function(response) {
    console.log(response.val());
  }, function(error) {
    console.log('retrieval failed: ' + error.code);
  });
}

var items = hackerfire.getItem([ '8265435', '8168423' ]);

for(var i = 0; i < items.length; i++) {
  items.on('value', function(response) {
    console.log(response.val());
  }, function(error) {
    console.log('retrieval failed: ' + error.code);
  });
}

For more information on how firebase works for retrieving data, check out their docs: https://www.firebase.com/docs/web/guide/retrieving-data.html

Tests

npm install

gulp tests

Issues

Issues

License

MIT License

Keywords

FAQs

Package last updated on 12 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc