Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simov/slack-command-hackernews
HackerNews /slash Command for Slack
https://github.com/simov/slack-command-hackernews
slack
Last synced: 1 day ago
JSON representation
HackerNews /slash Command for Slack
- Host: GitHub
- URL: https://github.com/simov/slack-command-hackernews
- Owner: simov
- License: apache-2.0
- Created: 2017-06-03T10:20:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-22T12:49:38.000Z (almost 6 years ago)
- Last Synced: 2024-10-10T20:19:55.348Z (29 days ago)
- Topics: slack
- Language: JavaScript
- Size: 42 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slack-command-hackernews
[![npm-version]][npm] [![travis-ci]][travis] [![coveralls-status]][coveralls]
> HackerNews /slash Command for Slack
## middleware
```js
var express = require('express')
var hackernews = require('slack-command-hackernews')
var auth = {token: 'hook token'}express()
.use(hackernews(auth))
.listen(3000)
```## api
```js
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[npm-version]: https://img.shields.io/npm/v/slack-command-hackernews.svg?style=flat-square (NPM Package Version)
[travis-ci]: https://img.shields.io/travis/simov/slack-command-hackernews/master.svg?style=flat-square (Build Status - Travis CI)
[coveralls-status]: https://img.shields.io/coveralls/simov/slack-command-hackernews.svg?style=flat-square (Test Coverage - Coveralls)[npm]: https://www.npmjs.com/package/slack-command-hackernews
[travis]: https://travis-ci.org/simov/slack-command-hackernews
[coveralls]: https://coveralls.io/github/simov/slack-command-hackernews