Skip to content

Commit f89422f

Browse files
committed
Merge pull request github-tools#24 from marynaaleksandrova/master
Add user follow/unfollow
2 parents 1c7e5e6 + ca4d418 commit f89422f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

github.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,24 @@
111111
cb(err, res);
112112
});
113113
};
114+
115+
// Follow user
116+
// -------
117+
118+
this.follow = function(username, cb) {
119+
_request("PUT", "/user/following/"+username, null, function(err, res) {
120+
cb(err, res);
121+
});
122+
};
123+
124+
// Unfollow user
125+
// -------
126+
127+
this.unfollow = function(username, cb) {
128+
_request("DELETE", "/user/following/"+username, null, function(err, res) {
129+
cb(err, res);
130+
});
131+
};
114132
};
115133

116134

0 commit comments

Comments
 (0)