From fc28423141d36679f56face643ccd8a0de64de6b Mon Sep 17 00:00:00 2001 From: Stephen Yeargin Date: Mon, 20 Jul 2015 01:02:45 -0500 Subject: [PATCH] Remove grafana.coffee Proposing the deprecation of this in favor of the [hubot-grafana](https://www.npmjs.com/package/hubot-grafana) package, which offers cross-adapter support, dashboard browsing and can be augmented with Amazon S3 credentials. Fixes #2206 --- vendor/grafana.coffee | 60 ------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 vendor/grafana.coffee diff --git a/vendor/grafana.coffee b/vendor/grafana.coffee deleted file mode 100644 index 2467fc0ccd6..00000000000 --- a/vendor/grafana.coffee +++ /dev/null @@ -1,60 +0,0 @@ -# Description: -# A way to interact with the Google Images API. -# -# Commands: -# hubot image me - The Original. Queries Google Images for and returns a random top result. -# hubot animate me - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead. -# hubot mustache me - Adds a mustache to the specified URL. -# hubot mustache me - Searches Google Images for the specified query and mustaches it. - -module.exports = (robot) -> - robot.hear /grafana (.*)/i, (msg) -> - sendUrl msg.match[1] - - robot.router.get '/hubot/test', (req, res) -> - sendUrl() - res.send 'OK ' - -imageMe = (msg, cb) -> - cb 'http://localhost:3000/render/dashboard/solo/grafana-play-home?from=now-1h&to=now&panelId=4&fullscreen' - -sendUrl = (params) -> - https = require 'https' - querystring = require 'querystring' - opts = params.split(' ') - dashboard = opts[0] - panelId = opts[1] - from = opts[2] - - imageUrl = "http://localhost:3000/render/dashboard/solo/#{dashboard}/?panelId=#{panelId}" - link = "http://localhost:3000/dashboard/db/#{dashboard}/?panelId=#{panelId}&fullscreen" - if from - imageUrl += "&from=#{from}" - link += "&from=#{from}" - - console.log 'imageUrl: ' + imageUrl - - hipchat = {} - hipchat.format = 'json' - hipchat.auth_token = process.env.HUBOT_HIPCHAT_TOKEN - console.log 'token: ' + hipchat.auth_token - - hipchat.room_id = '877465' - hipchat.message = "" - hipchat.from = "hubot" - hipchat.message_format = "html" - - params = querystring.stringify(hipchat) - - path = "/v1/rooms/message/?#{params}" - - data = '' - - https.get {host: 'api.hipchat.com', path: path}, (res) -> - res.on 'data', (chunk) -> - data += chunk.toString() - res.on 'end', () -> - json = JSON.parse(data) - console.log "Hipchat response ", data - -