From 1d65ae1662c402d7e755364531dc2b4e38410a01 Mon Sep 17 00:00:00 2001 From: FajitaNachos Date: Sat, 11 May 2013 16:19:18 +0900 Subject: [PATCH] Add user notifications. --- README.md | 8 +++++++- github.js | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4674fda1..4e116f4c 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,13 @@ user.orgs(function(err, orgs) {}); List authenticated user's gists. ```js -user.gists(username, function(err, gists) {}); +user.gists(function(err, gists) {}); +``` + +List unread notifications for the authenticated user. + +```js +user.notifications(function(err, notifications) {}); ``` Show user information for a particular username. Also works for organizations. diff --git a/github.js b/github.js index ac8749c6..5ffe0ac1 100644 --- a/github.js +++ b/github.js @@ -86,6 +86,15 @@ }); }; + // List authenticated user's unread notifications + // ------- + + this.notifications = function(cb) { + _request("GET", "/notifications", null, function(err, res) { + cb(err,res); + }); + }; + // Show user information // -------