Permalink
Browse files

Added subscriber api methods

  • Loading branch information...
1 parent e67801b commit 17af5fea019643f7c51838cb87ac777ff7874b4a @andzdroid committed Jun 14, 2011
Showing with 29 additions and 2 deletions.
  1. +9 −2 README.md
  2. +20 −0 lib/posterous.js
View
@@ -116,5 +116,12 @@ The possible keys in the `options` dictionary are `page` which determines which
### getContributors(id, callback)
`getContributors` retrieves the contributors of a Posterous. This method corresponds to the API endpoint `sites/:id/contributors`.
-### deleteContributors(id, user, callback)
-`deleteContributors` removes a user (specified by ID) from the list of contributors of a site. This method corresponds to the API endpoint `sites/:id/contributors/:user`.
+### removeContributor(id, user, callback)
+`removeContributor` removes a user (specified by ID) from the list of contributors of a site. This method corresponds to the API endpoint `sites/:id/contributors/:user`.
+
+## Subscribers
+### getSubscribers(id, callback)
+`getSubscribers` retrieves the subscribers of a Posterous. This method corresponds to the API endpoint `sites/:id/subscribers`.
+
+### removeSubscriber(id, user, callback)
+`removeSubscriber` removes a user (specified by ID) from the list of subscribers of a site. This method corresponds to the API endpoint `sites/:id/subscribers/:user`.
View
@@ -284,6 +284,26 @@ Posterous.prototype.removeContributor = function removeContributor(id, user, cal
};
+//Subscribers
+Posterous.prototype.getSubscribers = function getSubscribers(id, callback) {
+ this.request('GET', 'sites/' + id + '/subscribers', null, function(err, result) {
+ if (err) {
+ return callback(err);
+ }
+
+ callback(null, result);
+ });
+};
+
+Posterous.prototype.removeSubscriber = function removeSubscriber(id, user, callback) {
+ this.request('DELETE', 'sites/' + id + '/subscribers/' + user, null, function(err, result) {
+ if (err) {
+ return callback(err);
+ }
+
+ callback(null, result);
+ });
+};
module.exports = Posterous;

0 comments on commit 17af5fe

Please sign in to comment.