Giter VIP home page Giter VIP logo

hackbot's Introduction

hackbot

A customizable Facebook Group embetterment robot.

Installation/Usage

You'll need to set a few configuration options before using the hackbot in config.json. Add your Facebook Group ID, the refresh rate in milliseconds, 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_groups and publish_actions permissions are ticked. 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 and pass it as an environment variable. Then you should be good to go!

$ env ACCESS_TOKEN=[LONG_LIVED_ACCESS_TOKEN] npm start

Currently, there is no way to update the access token without restarting the hackbot.

Keep in mind that Facebook's user IDs are unique to each application, so you'll have to find some way of finding out moderator IDs using the Graph API.

Adding Filters

You can add feed filters under the lib/filters directory. An example closed thread filter is provided.

Filters are functions that receive an array of arrays of posts. Each item in the outer array represents a post/comment thread on the Facebook Group. Items of the inner arrays are Post objects, with their first items being the original post.

If you add a filter, make sure to add its exported function to the startRefreshing() call in the index file.

TODOs

  • Add more fun and useful filters.
  • Automatically update the access token through OAuth.
  • Remove the dependency on the fb package.
  • Create a simple administrative interface.
  • Implement a logging infrastructure for filters.
  • Allow for refreshing multiple groups.

Contributors

Made with โ™ฅ and caffeine at MHacks V by Alex Kern and Eva Zheng.

License

MIT

hackbot's People

Contributors

kern avatar

Watchers

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