Skip to content

Commit 49f9608

Browse files
committed
A new face for hackbot.
1 parent 1a168a9 commit 49f9608

27 files changed

+160
-167
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ doc
3535
# Hackbot
3636
hackbot.db
3737
record
38+
dist

.npmignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Logs
2+
log
3+
logs
4+
*.log
5+
npm-debug.log*
6+
7+
# Runtime data
8+
pids
9+
*.pid
10+
*.seed
11+
12+
# Directory for instrumented libs generated by jscoverage/JSCover
13+
lib-cov
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
18+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
19+
.grunt
20+
21+
# node-waf configuration
22+
.lock-wscript
23+
24+
# Compiled binary addons (http://nodejs.org/api/addons.html)
25+
build/Release
26+
27+
# Dependency directory
28+
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
29+
node_modules
30+
31+
# OSX
32+
.DS_Store
33+
.DS_Store?
34+
._*
35+
.Spotlight-V100
36+
.Trashes
37+
ehthumbs.db
38+
Thumbs.db
39+
.AppleDouble
40+
.LSOverride
41+
Icon
42+
43+
# Java
44+
*.class
45+
46+
# Sources
47+
src
48+
resources/logo.png
49+
resources/logo.sketch

README.md

Lines changed: 18 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
# hackbot
1+
<img src="https://raw.githubusercontent.com/kern/hackbot/master/resources/logo.png" alt="hackbot" width="254" />
22

3-
A customizable Facebook Group embetterment robot.
3+
Hackbot adds features to Facebook Groups through automation.
44

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).
106

117
## Installation
128

@@ -46,73 +42,34 @@ web-based flow][oauth-issue].
4642
[explorer]: https://developers.facebook.com/tools/explorer/
4743
[oauth-issue]: https://github.com/kern/hackbot/issues/6
4844

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
6346

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

72-
### 4. Set up Hackbot basic
50+
[explorer]: https://developers.facebook.com/tools/explorer/
7351

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
7753

78-
$ export BASIC=1
54+
$ npm install -g hackbot
7955

8056
## Usage
8157

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:
9159

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
9461

95-
Logs are stored in `log/` and are rotated daily. To view the logs:
62+
## Development
9663

97-
$ npm run log
64+
Hackbot uses [JavaScript Standard Style](https://github.com/feross/standard) and [Babel](https://babeljs.io/) for ES6+ support.
9865

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]
10969

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:
11271

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
11673

11774
## License & Acknowledgements
11875

doc/conf.json

Lines changed: 0 additions & 10 deletions
This file was deleted.
-30.6 KB
Binary file not shown.
-43.8 KB
Binary file not shown.

index.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/log.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

log/.gitignore

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)