per_page=300, and some log

This commit is contained in:
jysperm
2014-07-27 11:02:05 +08:00
parent 025c1b5316
commit 7519e6c67f

View File

@@ -27,7 +27,7 @@ app.use harp.mount(path.join(__dirname, 'static'))
app.get '/:username', (req, res) ->
username = req.param 'username'
sendRequest "/users/#{username}/events", (err, _res, body) ->
sendRequest "/users/#{username}/events?per_page=300", (err, _res, body) ->
events = _.filter JSON.parse(body), (event) ->
return event.type == 'PushEvent'
@@ -69,6 +69,9 @@ app.get '/:username', (req, res) ->
for commit in commits
cal.addEvent commit
console.log "[Request by] #{username}"
console.log "[X-RateLimit-Remaining] #{_res.headers['x-ratelimit-remaining']}"
res.header 'Content-Type', 'text/calendar; charset=utf-8'
res.status(200).end(cal.toString())