Git Product home page Git Product logo

mattermost-integration-giphy's Introduction

Giphy Integration Service for Mattermost

This integrations service is used to enable an external search engine (Giphy) to be queried based on commands issued in a Mattermost channel using Mattermost outgoing webhooks.

Once installed, users can type gif: keyword to send a query to the Giphy search engine and return with a post containing one non-deterministic search result from the Giphy database of animated GIF files matching keyword. The animation will appear below in the posted message.

Powered by Giphy.

Requirements

To run this integration you need:

  1. A web server supporting Python 3.6. Previous versions of this fork required 2.7.
  2. A Mattermost account where outgoing webhooks are enabled

Many web server options will work, below we provide instructions for Heroku and a general Linux/Ubuntu server.

Ubuntu Linux 18.04 Install

The following procedure shows how to install this project on a Linux web server running Ubuntu 18.04. The following instructions work behind a firewall so long as the web server has access to your Mattermost instances.

Giphy integration service download and environment configuration

sudo apt install python3-pip python3-dev build-essential -y
sudo git clone https://github.com/dwaynepryce/mattermost-integration-giphy.git /opt/mattermost-integration-giphy
sudo chown -R mattermost:mattermost /opt/mattermost-integration-giphy
cd /opt/mattermost-integration-giphy
sudo su mattermost
python3 -m pip install virtualenv
python3 -m virtualenv -ppython3 venv
source venv/bin/activate
pip install -r requirements-frozen.txt
python setup.py install

Mattermost configuration

  1. Log in to your Mattermost account. Click the three dot menu at the top of the left-hand side and go to Integrations > Slash Commands
  2. Under Add a new command, enter gif into Command Trigger Word
  3. Paste your Web Server domain into Callback URLs, making sure to add http:// to the beginning and /new_post to the end so it looks similar to http://<your-web-server-domain>:<MATTERMOST_GIPHY_PORT>/new_post and click Add
  4. Select POST method
  5. (optional) Choose a username and icon url (more details here)
  6. (optional) Check the autocomplete checkbox, add [KEYWORD] as the hint, Returns a GIF from Giphy based on the keyword as the description and Get a GIF from Giphy as the descriptive label
  7. Copy the Token from your newly created slash command that appears under the Existing commands section

Final Giphy integration service runtime configuration

Edit env.sh and put the Token from the Mattermost configuration in MATTERMOST_GIPHY_TOKEN.

sudo cp /opt/mattermost-integration-giphy/mattermost-integration-giphy.service /lib/systemd/system/mattermost-integration-giphy.service
sudo systemctl enable mattermost-integration-giphy.service
sudo systemctl start mattermost-integration-giphy.service

That's it! You should be able to type gif: hello or /gif hello into any channel and see a GIF from Giphy's translate service

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.