Git Product home page Git Product logo

notifyslack's Introduction

WP and Slack Logo

NotifySlack

About

This small node.js app will send your personal WordPress.com notifications to a Slack room.

To get setup you will need:

Setup the App

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).

Register a WordPress.com App

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.

Create a custom Slack hook

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).

Set it Running

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.

Heroku

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.

Bugs

At the moment the app does not correctly set the messages as seen. This is being worked on.

notifyslack's People

Contributors

scottsweb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.