A Giphy bot for Basecamp
A Giphy bot of the simplest kind….only for Basecamp… written in Elixir!
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/
git clone git@github.com:some-bots/basecamp-giphy-elixir.git
cd basecamp-giphy-elixir
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
Configure chatbots
Add a new chatbot
assets/giphy logo.png
as the bot’s avatargiphy
(any name will do)/cmd
on the endNote: Replace
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: