HackerNews /slash Command for Slack
var express = require('express')
var hackernews = require('slack-command-hackernews')
var auth = {token: 'hook token'}
express()
.use(hackernews(auth))
.listen(3000)
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)
Option | Value |
---|---|
Command | /hackernews |
Request URL | https://website.com/hackernews |
Short Description | Query HackerNews |
Usage Hint | `[new |
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 |