Skip to content
This repository was archived by the owner on Aug 31, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions github.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@
// Update a user's info. You must be authenticated as this user for this to
// succeed.
//
// TODO: example
// gh.user("fitzgen").update({name: "Nick Fitzgerald"});
//
// Possible attributes to update include:
// - name
// - email
// - blog
// - company
// - location
gh.user.prototype.update = function (params) {
authRequired(this.username);
var key, postData = {
Expand All @@ -175,22 +182,26 @@

// Get a list of who this user is following.
//
// TODO: example
// gh.user("fitzgen").following(function (data) {
// console.log(data.users);
// });
gh.user.prototype.following = function (callback, context) {
jsonp("user/show/" + this.username + "/following", callback, context);
};

// Find out what other users are following this user.
//
// TODO: example
// gh.user("fitzgen").followers(function (data) {
// console.log(data.users);
// });
gh.user.prototype.followers = function (callback, context) {
jsonp("user/show/" + this.username + "/followers", callback, context);
};

// Make this user follow some other user. You must be authenticated as this
// user for this to succeed.
//
// TODO: example
// gh.user("fitzgen").follow("mikepack");
gh.user.prototype.follow = function (user) {
authRequired.call(this);
post("user/follow/" + user);
Expand All @@ -200,7 +211,7 @@
// Make this user quit following the given `user`. You must be authenticated
// as this user to succeed.
//
// TODO: example
// gh.user("fitzgen").unfollow("mikepack");
gh.user.prototype.unfollow = function (user) {
authRequired.call(this);
post("user/unfollow/" + user);
Expand All @@ -209,7 +220,9 @@

// Get a list of repositories that this user is watching.
//
// TODO: example
// gh.user("fitzgen").watching(function (data) {
// console.log(data.repositories);
// });
gh.user.prototype.watching = function (callback, context) {
jsonp("repos/watched/" + this.username, callback, context);
return this;
Expand Down