Skip to content

some-bots/basecamp-giphy-elixir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basecamp-giphy-elixir

A Giphy bot of the simplest kind....only for Basecamp... written in Elixir!

Setup

Giphy API Key

To use the GIPHY API, you'll need to obtain an API Key by creating an app. You'll need a GIPHY account to create an app (don't worry, it's free!) Each application you create will have its own API Key. Don't worry if you're not sure what you want to use the GIPHY API for yet, all that's needed to create an app is a name and a basic description, which can be changed at any time.

Start here: 👉 https://developers.giphy.com/docs/

Clone the repo

git clone git@github.com:some-bots/basecamp-giphy-elixir.git
cd basecamp-giphy-elixir

Setup a Heroku app

Ensure you have the Heroku CLI and are logged in.

Create an app

heroku create

Set a buildpack

heroku buildpacks:set https://github.com/HashNuke/heroku-buildpack-elixir.git

Set your config vars

heroku config:set GIPHY_API_KEY=<<the giphy api key created above>>
heroku config:set PORT=80

Deploy

git push heroku master

Setup Basecamp App

add-chat-bot

  1. Go to your HQ (any any team/project) and click the ellipsis at the top right
  2. Select Configure chatbots
  3. Click Add a new chatbot
  4. Optional Upload assets/giphy logo.png as the bot's avatar
  5. Name is giphy (any name will do)
  6. Enter the url of your Heroku app created above with the /cmd on the end

Testing Locally

Note: Replace with your actual Giphy API Key.

Install dependencies

PORT=4000 GIPHY_API_KEY=<key> mix deps.get

Start the server

PORT=4000 GIPHY_API_KEY=<key> heroku local

Open your browser to http://localhost:4000 and you should be greeted with Hi from Basecamp-giphy-elixir bot! 🤖.

You can send test queries using curl:

 curl -H "Content-Type: application/json" -d '{"command":"test"}' localhost:4000/cmd

or via the convenience url to test in the browser:

http://localhost:4000/cmd/test

Releases

No releases published

Packages

No packages published

Languages