Giter VIP home page Giter VIP logo

buffit's Introduction

buffit logo

This app is built with Node and Express, and comes ready to go for Heroku deployment.

Other modules used are the body-parser middleware for express and request for simplified HTTP requests. You can also check out the Slack API and the Buffer API documentation for more information.

Get you an app for your Buffer

First thing you should is set up an app for your [Buffer account](http://buffer.com/developers), and take note of the credentials:
  • client_id
  • client_secret (you'll receive this by email)
  • access_token

redirect_uri is required to set up the app, however, you won't be in need of that for the slash command.

Deploy the code to Heroku

Next step is deploying the code to Heroku. But **before you do**, check the `PROFILE_IDS` object in the code and add the profiles you would like to post to.
const PROFILE_IDS =
{
  'service': ['username']
};

A little explanation how it works:

  • the app makes a request to the Buffer API for the list of profiles you have.
  • the app will then search for service, then username in the packet that was received. It'll get the corresponding id for use in the API request.
  • the service values are an array, so just add the usernames of any profile for that service. For example, if you have two Twitter profiles you'd like to post to, add 'twitter': [ 'handle1', 'handle2' ] to the object.

Once you've done that and deployed the code, take note of the URL to your app in Settings. (should be an https URL). This is also where your Config Vars are located, so plug those Buffer credentials in there.

Set up a slash command integration for your Slack group

Check out [this page](https://my.slack.com/services/new/slash-commands) on steps to do that.

You'll use the Heroku URL at set up, with the "/command" route at the end. (ex: https:// yourapp.herokuapp.com /command) Also take note of the access token it gives you, and go back to your Config Vars in the Heroku settings and plug it in.

Test it out!

A simple `/buffit` (or actually, whatever slash command you gave at set up) and `hello world` to test and you're good to go! The app will post back to the channel where you initiated the command with a nice "thank you" message. And double check your Buffer queue for the post. :)

Any issues you find, feel free to let me know or make a pull request. Hope you like it!

buffit's People

Watchers

montae jones 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.