bencentra / hubot-giphy-gifme Goto Github PK
View Code? Open in Web Editor NEW"gif me" command for Hubot, get random GIFs from Giphy!
License: MIT License
"gif me" command for Hubot, get random GIFs from Giphy!
License: MIT License
We are using Flowdock with Hubot and your script. Sometimes the gifs are that huge, it will just lag everyone's client to death. Would it be possible to implement an option to limit size or even better provide downsampled results if they exceed the given size limit?
The giphy API seems to be supporting this. Just take a look at the example response: https://github.com/Giphy/GiphyAPI#random-endpoint
We're currently using the random api endpoint filtered by tags:
https://github.com/Giphy/GiphyAPI#random-endpoint
Tags are a little restricting, as often they return no results, which is pretty much the worst case scenario when trying to summon a random gif to brighten all your friend's days.
Let's instead take the top of random result from a simpler search query:
https://github.com/Giphy/GiphyAPI#search-endpoint
This could perhaps be a flag so that change isn't forced. Thoughts?
It could default to the public key, but it should at least look for an env variable with the user's own key
hubot-slack adapter chokes when a message with no content is sent, and seems that this happens when there's no results:
192 2016-02-13T01:41:55.548847+00:00 app[web.1]: [Sat Feb 13 2016 01:41:55 GMT+0000 (UTC)] ERROR TypeError: Cannot read property 'length' of undefined
193 2016-02-13T01:41:55.548851+00:00 app[web.1]: at SlackBot.send (/app/node_modules/hubot-slack/src/slack.coffee:226:7, <js>:275:16)
194 2016-02-13T01:41:55.548852+00:00 app[web.1]: at runAdapterSend (/app/node_modules/hubot/src/response.coffee:82:34, <js>:87:50)
195 2016-02-13T01:41:55.548853+00:00 app[web.1]: at allDone (/app/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
196 2016-02-13T01:41:55.548854+00:00 app[web.1]: at /app/node_modules/async/lib/async.js:274:13
197 2016-02-13T01:41:55.548854+00:00 app[web.1]: at Object.async.eachSeries (/app/node_modules/async/lib/async.js:142:20)
198 2016-02-13T01:41:55.548855+00:00 app[web.1]: at Object.async.reduce (/app/node_modules/async/lib/async.js:268:15)
199 2016-02-13T01:41:55.548856+00:00 app[web.1]: at /app/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
200 2016-02-13T01:41:55.548857+00:00 app[web.1]: at nextTickCallbackWith0Args (node.js:453:9)
201 2016-02-13T01:41:55.548857+00:00 app[web.1]: at process._tickCallback (node.js:382:13)
Would be great to catch undefined results before kicking them to robot.send
:)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.