Permalink
Browse files

Added external autopost sites api methods

  • Loading branch information...
andzdroid committed Jun 16, 2011
1 parent 2d97a8a commit bda8610b7555c16df9f97253e2bedebeb7ceb25f
Showing with 31 additions and 1 deletion.
  1. +11 −1 README.md
  2. +20 −0 lib/posterous.js
View
@@ -133,7 +133,7 @@ The options parameter must be the same as in `createSiteProfile`.
### unsubscribe(id, callback)
`unsubscribe` removes the user's subscription to the site specified by the *site id*. This method corresponds to the API endpoint `sites/:id/unsubscribe`.
-# Site header
+## Site header
### setHeader(id, file, callback)
`setHeader` sets a new header image for the site. This method corresponds to the API endpoint `sites/:id/header_image`.
@@ -157,3 +157,13 @@ The options parameter must be the same as in `createSiteProfile`.
### 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`.
+
+## External Autopost sites
+### getAutopostSites(id, callback)
+`getAutopostSites` retrieves a list of all external autopost sites for a Posterous. This method corresponds to the API endpoint `sites/:id/external_sites`.
+
+### getAutopostSite(id, autopost\_id, callback)
+`getAutopostSite` retrieves a single external autopost site by its ID. This method corresponds to the API endpoint `sites/:id/external_sites/:autopost_id`.
+
+### deleteAutopostSite(id, autopost\_id, callback)
+`deleteAutopostSite` removes a single external autopost site by ID. This method corresponds ot the API endpoint `sites/:id/external_sites/:autopost_id`.
View
@@ -271,4 +271,24 @@ Posterous.prototype.removeSubscriber = function(id, user, callback) {
};
+//Autopost sites
+Posterous.prototype.getAutopostSites = function(id, callback) {
+ this.request('GET', 'sites/' + id + '/external_sites', null, function(err, result) {
+ callback(err, result);
+ });
+};
+
+Posterous.prototype.getAutopostSite = function(id, autopost, callback) {
+ this.request('GET', 'sites/' + id + '/external_sites/' + autopost, null, function(err, result) {
+ callback(err, result);
+ });
+};
+
+Posterous.prototype.deleteAutopostSite = function(id, autopost, callback) {
+ this.request('DELETE', 'sites/' + id + '/external_sites/' + autopost, null, function(err, result) {
+ callback(err, result);
+ });
+};
+
+
module.exports = Posterous;

0 comments on commit bda8610

Please sign in to comment.