mirror of
https://github.com/HackPlan/github-commit-ical.git
synced 2026-01-12 15:04:45 +08:00
per_page=300, and some log
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user