Giter Site home page Giter Site logo

gifbot's Introduction

Gifbot

Gifbot is a lightweight Sinatra app that provides Slack with embedded keyword search for animated GIFs, using the Giphy API, and Slack's webhooks integration. Once setup, you can type #puppies in your Slack channel, and Gifbot will post a random animated GIF of adorable puppies to the channel.

Seriously?

image

Yes.

Why?

What better way to celebrate a teammate's bon mot, or to herald a successful code deployment, or announce your imminent departure for lunch?

How?

  • Download Gifbot and run bundle install --path .gems in the gifbot directory. You may need to sudo gem install bundler first.

  • Set up an outgoing webhook migration in Slack using http://host:port/gif as the URL, substituting the host and port that you'll be running the server on. (Unless you tell it otherwise, Sinatra runs on port 4567 by default.) You may opt to configure # as the default trigger word for the webhook.

  • Slack will give you an application token for this integration; note it.

  • Edit gifbot.rb and set your SLACK_TOKEN. You must do this or Gifbot will ignore all attempts to communicate.

  • Optionally, set GIPHY_KEY to your Giphy key, if you have one. The provided key is Giphy's public beta token and works out of the box, but they like you to contact them and ask for a real key if you're using Giphy for serious. You can also change the trigger word and the image style.

  • Run ./start_gifbot.sh on a public webserver, in a screen(1) session or something.

  • Type #kittens into your Slack chat and voilà.

Are you kidding?

This software took me 20 minutes to write and is released into the public domain. If it breaks, you get to keep all the pieces. Patches welcome, and hugs for everyone.

SDE

=30=

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.