Looks good, I'll change
On Jun 3, 2014 8:13 PM, "Parker Moore" <notifications@github.com> wrote:

> In src/scripts/google-images.coffee:
>
> > @@ -39,6 +39,14 @@ imageMe = (msg, query, animated, faces, cb) ->
> >        images = JSON.parse(body)
> >        images = images.responseData?.results
> >        if images?.length > 0
> > -        image  = msg.random images
> > -        cb "#{image.unescapedUrl}#.png"
> > +        image = msg.random images
> > +        cb ensureImageExtension image.unescapedUrl
> > +
> > +ensureImageExtension = (url) ->
> > +  ext = url.split('.').pop()
> > +
> > +  if ['png', 'jpeg', 'jpg', 'gif'].indexOf(ext) != -1
> > +    return url
> > +
> > +  return "#{url}#.png"
>
> What about
>
> ensureImageExtension = (url) ->
>   ext = url.split(".").pop()
>   if /(png|jpe?g|gif)/.test(ext)
>     url
>   else
>     "#{url}#.png"
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/github/hubot/pull/708/files#r13349832>.
>