A Hubot script to store and search links posted to Slack using Firebase!
You will need to sign up for a Firebase account here
You will then need to init a Firebase App instance for your Hubot.
Generally I do this by creating an _init.coffee
file in the scripts
directory.
This script will always be run first, and there you can init your Firebase App.
Example contents:
# _init.coffee
Firebase = require 'firebase'
config = {
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
databaseURL: process.env.FIREBASE_DATABASE_URL,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
}
Firebase.initializeApp(config)
$ npm i -S hubot-slack-link-manager
// external-scripts.json
[
...
"hubot-slack-link-manager"
]
-
hubot save <link> | <description>
- saves a link with the given description -
hubot show links
- show all saved links -
hubot search links <query>
- fuzzy match link description and query -
hubot show user links <user>
- shows all links a user has posted
This script will listen for any URL posted in rooms that Hubot is a member of.
It will make a naive GET request to the URL in an attempt to get info about the page from og
tags.
Falls back to the <title>
tag, or if the request itself fails, null
is saved as the description.
Users can also manually save links.
- Make a pull request!