ferd-directions
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -37,4 +37,2 @@ var request = require('request'); | ||
var directions = []; | ||
request(url, function (error, response, body) { | ||
@@ -56,2 +54,12 @@ | ||
var distance = result.routes[0].legs[0].distance.text; | ||
var duration = result.routes[0].legs[0].duration.text; | ||
var directions = [{ | ||
"fallback": 'Directions', | ||
"text": 'Directions\n\nFrom: *' + origin + '* \nTo: *' + destination + '*\n\nDistance: *' + distance + '*\nDuration: *' + duration + '*\n', | ||
"color": '#000', | ||
"mrkdwn_in": ["text"] | ||
}]; | ||
_.each(result.routes[0].legs[0].steps, function(step) { | ||
@@ -85,3 +93,3 @@ if(count === result.routes[0].legs[0].steps.length-1) { | ||
as_user: true, | ||
text: 'Directions from *' + origin + '* to *' + destination + '*:\n\n', | ||
text: '', | ||
attachments: JSON.stringify(directions) | ||
@@ -88,0 +96,0 @@ }); |
{ | ||
"name": "ferd-directions", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Ferd directions", | ||
@@ -18,5 +18,5 @@ "main": "directions.js", | ||
"readme": "ERROR: No README data found!", | ||
"_id": "ferd-directions@0.0.1", | ||
"_shasum": "927d5c16627b6a30f2a13a44ae17fc9cd40bba32", | ||
"_id": "ferd-directions@0.0.4", | ||
"_shasum": "9019cc996fca6bd21d2f6ec14189b74aea42a732", | ||
"_from": "ferd-directions@*" | ||
} |
4733
117