|
1 |
| -# hackbot |
| 1 | +<img src="https://raw.githubusercontent.com/kern/hackbot/master/resources/logo.png" alt="hackbot" width="254" /> |
2 | 2 |
|
3 |
| -A customizable Facebook Group embetterment robot. |
| 3 | +Hackbot adds features to Facebook Groups through automation. |
4 | 4 |
|
5 |
| -Hackbot uses the Facebook Graph API to implement extra moderative features that are not currently available to group administrators. At the moment, it only supports the closing of comment threads, but it's designed to be highly extensible. |
6 |
| - |
7 |
| -An instance of hackbot is running on [Hackathon Hackers][hh]. |
8 |
| - |
9 |
| -[hh]: http://hh.gd |
| 5 | +An instance of hackbot is running on [Hackathon Hackers](https://facebook.com/groups/hackathonhackers). |
10 | 6 |
|
11 | 7 | ## Installation
|
12 | 8 |
|
@@ -46,73 +42,34 @@ web-based flow][oauth-issue].
|
46 | 42 | [explorer]: https://developers.facebook.com/tools/explorer/
|
47 | 43 | [oauth-issue]: https://github.com/kern/hackbot/issues/6
|
48 | 44 |
|
49 |
| -### 2. Install dependencies |
50 |
| - |
51 |
| - $ npm install |
52 |
| - |
53 |
| -### 3. Set up Firebase |
54 |
| - |
55 |
| -Persistence is currently done via [Firebase](www.firebase.com). |
56 |
| - |
57 |
| -Set up a Firebase datastore and export the URL and secret as environment variables: |
58 |
| - |
59 |
| - $ export FIREBASE_SECRET='<yo-secret>' |
60 |
| - $ export FIREBASE_URL='<firebase-url> |
61 |
| - |
62 |
| -In your Firebase you need to add the following keys: |
| 45 | +### 2. Collect the Graph IDs of your group's moderators |
63 | 46 |
|
64 |
| -```json |
65 |
| -{ |
66 |
| - "accessToken": "<your-fb-access-token>", |
67 |
| - "id": "<your-fb-group-id>", |
68 |
| - "mods": ["<mod-id-1>", "<mod-id-2>"] |
69 |
| -} |
70 |
| -``` |
| 47 | +You can use the [Graph API Explorer][explorer] to find the numeric Graph API |
| 48 | +IDs of your group's moderators. |
71 | 49 |
|
72 |
| -### 4. Set up Hackbot basic |
| 50 | +[explorer]: https://developers.facebook.com/tools/explorer/ |
73 | 51 |
|
74 |
| -Hackbot has optional but on-by-default Twitter and MetaMind integrations. If |
75 |
| -you only wish to run the Facebook integrations you can set the following |
76 |
| -environment variable: |
| 52 | +### 3. Install Hackbot |
77 | 53 |
|
78 |
| - $ export BASIC=1 |
| 54 | + $ npm install -g hackbot |
79 | 55 |
|
80 | 56 | ## Usage
|
81 | 57 |
|
82 |
| -To start the hackbot, use your long-lived access token and run: |
83 |
| - |
84 |
| - $ env ACCESS_TOKEN=[LONG_LIVED_ACCESS_TOKEN] npm start |
85 |
| - |
86 |
| -Currently, there is no way to update the access token without restarting the |
87 |
| -hackbot. You can set the port for the HTTP server using the `PORT` environment |
88 |
| -variable. |
89 |
| - |
90 |
| -To generate the docs: |
| 58 | +There will be much better usage docs coming soon, but here's how it works: |
91 | 59 |
|
92 |
| - $ npm run doc |
93 |
| - $ open doc/index.html |
| 60 | + $ hackbot GROUP_ID ACCESS_TOKEN -m MOD_ID1,MOD_ID2,MOD_ID3 -s close,delete --interval 5 |
94 | 61 |
|
95 |
| -Logs are stored in `log/` and are rotated daily. To view the logs: |
| 62 | +## Development |
96 | 63 |
|
97 |
| - $ npm run log |
| 64 | +Hackbot uses [JavaScript Standard Style](https://github.com/feross/standard) and [Babel](https://babeljs.io/) for ES6+ support. |
98 | 65 |
|
99 |
| -## Adding Filters |
100 |
| - |
101 |
| -Filters are the fundamental units of extension for hackbot. |
102 |
| - |
103 |
| -You can add thread filters under the `lib/filters` directory. An [example |
104 |
| -closed thread filter][close-file] is provided. |
105 |
| - |
106 |
| -Filters are functions that receive an array of posts, representing a |
107 |
| -post/comment thread on the Facebook Group. Items of the array are [Post |
108 |
| -objects][post-file] where the first item is the original post. |
| 66 | + $ git clone [email protected]:pavlovml/gallup.git |
| 67 | + $ npm install |
| 68 | + $ npm run dev -- [see usage above] |
109 | 69 |
|
110 |
| -If you add a filter, make sure to add its exported function to the `filters` |
111 |
| -array in the [index file][index-file]. |
| 70 | +Lint before committing: |
112 | 71 |
|
113 |
| -[close-file]: https://github.com/kern/hackbot/blob/master/lib/filters/close.js |
114 |
| -[post-file]: https://github.com/kern/hackbot/blob/master/lib/Post.js |
115 |
| -[index-file]: https://github.com/kern/hackbot/blob/master/lib/index.js |
| 72 | + $ npm run lint |
116 | 73 |
|
117 | 74 | ## License & Acknowledgements
|
118 | 75 |
|
|
0 commit comments