Noteworthy Programming Masterpiece
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

slack-command-hackernews

2.2.1 • Public • Published

slack-command-hackernews

npm-version travis-ci coveralls-status

HackerNews /slash Command for Slack

middleware

var express = require('express')
var hackernews = require('slack-command-hackernews')
var auth = {token: 'hook token'}
 
express()
  .use(hackernews(auth))
  .listen(3000)

api

var express = require('express')
var parser = require('body-parser')
var hackernews = require('slack-command-hackernews')
var auth = {token: 'hook token'}
 
express()
  .use(parser.urlencoded({extended: true}))
  .use((req, res) => {
    var input = req.body
    res.json(hackernews.respond({auth, input}))
    hackernews.query({auth, input}).catch(console.error)
  })
  .listen(3000)

command

Option Value
Command /hackernews
Request URL https://website.com/hackernews
Short Description Query HackerNews
Usage Hint [new|top|best] [count]

example

Command Description
/hackernews the 5 newest stories
/hackernews new 5 the 5 newest stories
/hackernews top 3 the top 3 stories
/hackernews best 10 the 10 best stories
/hackernews help help message

Install

npm i slack-command-hackernews

DownloadsWeekly Downloads

3

Version

2.2.1

License

Apache-2.0

Unpacked Size

16.2 kB

Total Files

9

Last publish

Collaborators

  • avatar