- Status: ✔ Active
- Contributors: @scottsweb
- Description: node.js app to send your personal WordPress.com notifications to a Slack room.
- Author: Scott Evans
- Author URI: http://scott.ee
- License: GNU General Public License v2.0
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
This small node.js app will send your personal WordPress.com notifications to a Slack room.
To get setup you will need:
- To register a WordPress.com App
- Create a custom Slack Hook
Download or checkout this repository to your local machine. Browse to the downloaded directory in your terminal app and run: npm install
(you will need to have node and npm on your system).
Visit the WordPress.com Developer site and register a new app. Set the redirect URI to http://localhost:3000
and leave the JavaScript origins section blank. The rest of the information can be personalised to your own requirements.
Once setup make a note of the Client ID
and Client Secret
and add those to the settings array at the top of notifyslack.js
.
You can now obtain your oAuth token. Launch the app:
node notifyslack.js
and browse to:
localhost:3000
Follow the instructions on screen and keep an eye on your terminal. Once you have approved the app you will see your oAuth token in your terminal:
{ create: [Function: create],
token:
{ access_token: 'YOUR SECRET',
token_type: 'bearer',
blog_id: '0000000000',
blog_url: 'http://site.wordpress.com',
scope: '',
expires_at: Wed Dec 17 2014 09:54:36 GMT+0000 (GMT) },
expired: [Function: expired],
refresh: [Function: refresh],
revoke: [Function: revoke]
}
Copy your access token and add it to the settings array at the top of notifyslack.js
.
Visit the Slack website and create your custom webhook. Then add the URL to the settings array at the top of notifyslack.js
. You can also add your slack_channel
(the room you wish to post to) and slack_domain
(your company wide domain for your Slack account e.g: wordpress
).
Quit the node app with CTRL-C
and then set it running again: node notifyslack.js
.
You should now see the following in your terminal.
NotifySlack (http://0.0.0.0:3000)
Running NotifySlack...
No new notifications.
The app will check for new notifications every minute and post them to your Slack room.
The Heroku branch is for if you want to deploy the app online. You will need to move your app settings into config variables and then deploy the app using:
git push heroku heroku:master
Heroku have a great getting started guide to help you get setup.
At the moment the app does not correctly set the messages as seen. This is being worked on.