{"push_id":554554654,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"26cd023d1cda4390842633dc63746122c6de9978","before":"bae19ff858c0afb5ec7bd2411ebf3932ee8985c2","commits":[{"sha":"26cd023d1cda4390842633dc63746122c6de9978","author":{"email":"4afb36f68af238925ceb8bdd24ef12ec9c681d1d@gmail.com","name":"kashimoo"},"message":"[from now] 2015/01/24 01:56:47\n\ndiff --git a/scripts/desknets.coffee b/scripts/desknets.coffee\nnew file mode 100644\nindex 0000000..760fe42\n--- /dev/null\n+++ b/scripts/desknets.coffee\n@@ -0,0 +1,18 @@\n+module.exports = (robot) ->\n+\n+  robot.hear /inbox/i, (msg) ->\n+    robot.http(\"http://desknets.herokuapp.com/inbox\")\n+      .get() (err, res, body) ->\n+\n+        inbox = JSON.parse(body)\n+\n+        if inbox.status is 'ok'\n+          now = inbox.item.closemail\n+          last = if robot.brain.get('closemail') then robot.brain.get('closemail') else 0\n+\n+          msg.send \"#{now}/#{inbox.item.count}\"\n+          msg.send \"#{process.env.HUBOT_MEMBER} Check!\" if now > last\n+\n+          robot.brain.set 'closemail', now\n+        else\n+          msg.send \"#{process.env.HUBOT_MEMBER} Error!\"\ndiff --git a/scripts/inbox.coffee b/scripts/inbox.coffee\ndeleted file mode 100644\nindex da0e95c..0000000\n--- a/scripts/inbox.coffee\n+++ /dev/null\n@@ -1,17 +0,0 @@\n-module.exports = (robot) ->\n-\n-  robot.hear /g(omi)?/i, (msg) ->\n-    robot.http(\"http://desknets.herokuapp.com/inbox\")\n-      .get() (err, res, body) ->\n-\n-        inbox = JSON.parse(body)\n-\n-        now = inbox.unread\n-        last = robot.brain.get('unread')\n-\n-        if now < 0\n-          msg.send \"#{process.env.HUBOT_MEMBER} Error!\"\n-        else\n-          msg.send \"#{process.env.HUBOT_MEMBER} #{now}\" if now > last\n-\n-        robot.brain.set 'unread', inbox.unread","distinct":true,"url":"https://api.github.com/repos/kashimoo/masakun/commits/26cd023d1cda4390842633dc63746122c6de9978"}]}