From ccb3eceb56c1e1f56659e5ad8118b2d4d80d4e24 Mon Sep 17 00:00:00 2001 From: jysperm Date: Sun, 27 Jul 2014 11:30:38 +0800 Subject: [PATCH] fixbugs --- app.coffee | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app.coffee b/app.coffee index df82c9e..b417adc 100644 --- a/app.coffee +++ b/app.coffee @@ -44,16 +44,13 @@ app.get '/:username', (req, res) -> else sendRequest "/repos/#{event.repo.name}/git/commits/#{commit.sha}", (err, _res, body) -> - unless JSON.parse(body).committer.date - console.log JSON.parse(body) - - real_time = JSON.parse(body).committer.date + body = JSON.parse body result = - start: new Date real_time - end: new Date real_time + start: new Date body.committer.date + end: new Date body.committer.date summary: "#{commit.message} (#{event.repo.name})" - url: commit.html_url + url: body.html_url redis_client.set "github-commit-ical:#{commit.sha}", JSON.stringify(result), -> callback err, result