Skip to content

stuartquin/hncomments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HNComments

Embeddable Hackernews comment feeds.

Simple script for embedding Hacker News comments in a blog or article. Contributions from stuartquin and saralk

Hosted

The version hosted on hncomments.custardapp.com is intended for demo purposes only. For ensured reliability please clone and self host.

If people really like the hosted version please get in touch and we can discuss solutions for a more permanent, guaranteed hosted service.

Usage

Simply embed the following script in your blog or article:

  <div id="hncomments" data-post-id="..."></div>
  <script src="http://hncomments.custardapp.com/main.js"></script>  

data Parameters

The id="hncomments" element supports a range of data- parameters:

  • data-post-id: required Integer. ID of the hackernews comment thread
  • data-max-comments: Integer. Amount of comments to display
  • data-style: Boolean. If set to true the comments will be styled like the 'classic' hackernews feed.

Installation

hncomments is written in Node.js. It makes requests to and scrapes the required Hacker News comment streams.

git clone https://github.com/stuartquin/hncomments.git
cd hncomments
npm install .

node app.js 

By default hncomments uses redis for caching scraped comment feeds from Hacker News. You can change this behaviour by setting --cache memory on the command line. Run node app.js --help for full range of options

About

Embeddable Hackernews comments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •