GithubHelp home page GithubHelp logo

kamaal44 / hackbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kern/hackbot

0.0 1.0 0.0 430 KB

:coffee: Hackbot adds features to Facebook Groups through automation

License: BSD 3-Clause "New" or "Revised" License

JavaScript 98.07% Shell 1.93%

hackbot's Introduction

hackbot

npm shield js-standard-style

Hackbot adds features to Facebook Groups through automation.

An instance of Hackbot is running on Hackathon Hackers.

Installation

1. Install Hackbot

$ npm install -g hackbot

2. Get your long-lived Facebook access token

Note: This process is annoying. Please consider implementing this through a web-based OAuth flow.

You'll need to set a few configuration options before using Hackbot: your Facebook Group ID, the refresh rate in milliseconds (5s is a good number), and the IDs of the group's moderators to the configuration file.

To generate an access token, open up the Facebook Graph API Explorer and make sure you're using a custom application. Click "Get Access Token" and make sure the user_managed_groups and publish_actions permissions are ticked.

user_managed_groups permission

publish_actions permission

Click the blue "Get Access Token" in the modal. Copy the short-lived access token and navigate in your browser to the following URL:

https://graph.facebook.com/oauth/access_token?
    client_id=APP_ID&
    client_secret=APP_SECRET&
    grant_type=fb_exchange_token&
    fb_exchange_token=SHORT_LIVED_ACCESS_TOKEN

Replace APP_ID, APP_SECRET, and SHORT_LIVED_ACCESS_TOKEN with the proper values. Take the long-lived (60 day) access token in the body and save it somewhere for safe-keeping. You'll need it when you run Hackbot below.

3. Collect the Graph IDs of your group's moderators

You can use the Graph API Explorer to find the numeric Graph API IDs of your group's moderators.

Keep in mind that Facebook's user IDs are unique to each application, so you'll have to get creative. Try digging through your friends list at /me/friends?limit=1000.

Usage

There will be much better usage documentation coming soon, but here's how it works:

$ hackbot GROUP_ID ACCESS_TOKEN -m MOD_ID1,MOD_ID2,MOD_ID3 -s close,delete --interval 5

Development

Hackbot uses JavaScript Standard Style and Babel for ES6+ support.

$ git clone [email protected]:kern/hackbot.git
$ npm install
$ npm run dev -- [see usage above]

Lint before committing:

$ npm run lint

License & Acknowledgements

Hackbot is released under the BSD 3-Clause license. The initial prototype was made with caffeine at MHacks V by Alex Kern and Eva Zheng.

hackbot's People

Contributors

iangcarroll avatar kern avatar rubinovitz avatar yefim 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.