slackbot-links

command module
v0.0.0-...-4144d9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2017 License: MIT Imports: 6 Imported by: 0

README

Do you use Slack? Do you share links with your co-workers? SlackBot-Links store all theses urls, enrich them with metadata, and expose them through a REST API. You can now find shared urls by searching in their title, content, author name...

Get Started

go get github.com/jguyomard/slackbot-links

Note: You need to set GOPATH correctly before running this.

2. Create a new bot on Slack

Once you create this bot, you will get an API token. Create config.yaml and edit it to add your bot token:

cp $GOPATH/src/github.com/jguyomard/slackbot-links/config.yaml.sample /etc/slackbot-links/config.yaml
vi /etc/slackbot-links/config.yaml

Then, invite this bot to channels of your choice (#links for instance).

This bot use Elastic Search to save links. The client connects to Elasticsearch on http://localhost:9200 by default.

For instance, to start Elastic Search using official docker image:

docker run -d -p 9200:9200 elasticsearch:2
4. Run this bot

if $PATH contains $GOPATH/bin, slackbot-links command is now available:

slackbot-links -config-file=/etc/slackbot-links/config.yaml

Your bot is live! You can now share link on #links and fetch them using REST API :

curl localhost:9300/v1/links/

API

REST API Documentation can be found here.

This documentation is generated from API.apib file (API Blueprint syntax):

make docapi

Commands

restore

This command recreates the Elasticsearch index from a given links.log log file. This is very useful for fast testing with a given scenario, or for initializing a staging environment, for instance.

slackbot-links -config-file=/etc/slackbot-links/config.yaml -links-file=./links-tests.log restore

If a link already exists (same ID), it is updated.

Testing

To run the test suite:

make test

Issues

If you have any problems with or questions about this Service Provider, please contact me through a GitHub issue.

Contributing

You are invited to contribute new features, fixes or updates to this container, through a Github Pull Request.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL