Skip to content

Commit

Permalink
Based HUBOT_9GAG_NO_GIFS on variable definition and existential opera…
Browse files Browse the repository at this point in the history
…tor.
  • Loading branch information
dedeibel committed Feb 4, 2014
1 parent bbafcc7 commit 77f3e0f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/scripts/9gag.coffee
Expand Up @@ -6,7 +6,7 @@
# "soupselect": "0.2.0"
#
# Configuration:
# HUBOT_9GAG_NO_GIFS (optional; default is "false")
# HUBOT_9GAG_NO_GIFS (optional, skips GIFs if defined; default is undefined)
#
# Commands:
# hubot 9gag me - Returns a random meme image
Expand Down Expand Up @@ -40,9 +40,8 @@ send_meme = (message, location, response_handler)->
location = response.headers['location']
return send_meme( message, location, response_handler )

no_gifs = process.env.HUBOT_9GAG_NO_GIFS
selectors = ["a img.badge-item-img"]
if no_gifs != '0' && no_gifs != 't' && no_gifs != 'true'
if ! process.env.HUBOT_9GAG_NO_GIFS?
selectors.unshift("div.badge-animated-container-animated img")

img_src = get_meme_image( body, selectors )
Expand Down

0 comments on commit 77f3e0f

Please sign in to comment.