Giter Site home page Giter Site logo

artix41 / facebook-slack-integration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whitehatarpit/facebook-slack-integration

0.0 3.0 0.0 450 KB

Purpose of this integration is to receive a message on Slack for new Notifications and Messages received on Facebook.

Python 100.00%

facebook-slack-integration's Introduction

Facebook-Slack-Integration

Purpose of this integration is to receive a message on Slack for new Notifications and Messages received on Facebook.

Installing Facebook-Slack-Integration for your slack

  1. Obtaining Slack Incoming Webhook url:

    • Go to https://<your-team-name>.slack.com/services/new/incoming-webhook.
    • Choose @slackbot as channel and add Incoming Webhook Integration. slack new webhook
    • Copy the Webhook URL and enter it as slack_url in config variables at deployment stage.
    • Customize the webhook with your favorite name and icon (Facebook Favicon included) and save. slack webhook url
  2. Obtaining Facebook App ID and App Secret:

    • Go to Facebook Developers and register.
    • Follow instructions and create a new web app.
    • On you app's page, Copy the App ID and enter it as app_id in config variables at deployment stage.
    • Copy the App Secret and enter it as app_secret in config variables at deployment stage. fb app
  3. Obtaining Facebook User Access Token:

    • Go to Facebook Graph Explorer Tool.
    • Select your fb app in application dropdown and click 'get token' > 'get access token'.
    • Select user_about_me permission and from extended permissions select manage_notifications , read_mailbox , read_stream
    • Click get access token and enter the token generated as access_token in config variables at deployment stage. fb access token
  4. Deploying:

    • Deploy on heroku by creating a new app.

    • Set config variables slack_url app_id app_secret access_token in the settings tab of your app. heroku config variables

    • Fork and clone this repository to you local.

    • Add heroku remote to your local repo using the deploy instructions in the deploy tab of your heroku app.

    • Push to remote using command: git push heroku master

    • Check heroku ps to confirm that you web is working otherwise run command to start your app: heroku ps:scale web=1

  5. Keeping Active (for heroku deploys):

    • Heroku tends to kill the dyno if the app route is inactive for 30mins (may change). Hence, we will use one of the ping services available online. I chose HerokuPing.
    • Just submit your heroku app url there and it will ping your app every 10mins, firing up the facebook checking functions. herokuping

Using Facebook-Slack-Integration with slack

After above steps, Facebook-Slack-Integration will check new fb messages every time the app is pinged by the service you chose while checking new fb notifications every 6th time to keep you updated at your chosen slack channel for the webhook.

Limitations

You will need to re-generate your facebook access token (step 3) every 2 months. This is a restriction made by fb api for security reasons.

Support or Contact

Having trouble with Facebook-Slack-Integration? Create an issue in the repository GitHub Repo.

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.