{"_id":"posterous","_rev":"7-92083a75a52e75bb4d3d39b0a227e4b6","name":"posterous","description":"Package for the Posterous API","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"posterous","version":"1.0.0","description":"Package for the Posterous API","keywords":["posterous","api"],"contributors":[{"name":"Chun-hao Hu","email":"hu.chunhao@gmail.com","url":"http://blog.huchunhao.com"}],"bugs":{"url":"https://github.com/andzdroid/node-posterous/issues"},"repositories":[{"type":"git","url":"git@github.com:andzdroid/node-posterous.git"}],"dependencies":{},"main":"index","engines":["node"],"devDependencies":{},"_id":"posterous@1.0.0","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"027f818017e75f69c44b83166caabbb283ca7878","tarball":"https://registry.npmjs.org/posterous/-/posterous-1.0.0.tgz","integrity":"sha512-hGCremUzvSrpvv5tVv5eMe+uvYxUspAZvaayalGCe3OVnBytn6WdjEPNhSNnYubY/lRjBha8K4gKOHlS6KFMrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg5HN1jyKz89RnDlaceQObtdENZHgSZuskZ8tWm394rAIgCYPsF4gNcSJWo/uzT6kDuZp1mdV1UhMkf9QxDVW6eI4="}]},"scripts":{}},"1.1.0":{"name":"posterous","version":"1.1.0","description":"Package for the Posterous API","keywords":["posterous","api"],"contributors":[{"name":"Chun-hao Hu","email":"hu.chunhao@gmail.com","url":"http://blog.huchunhao.com"}],"bugs":{"web":"https://github.com/andzdroid/node-posterous/issues"},"repositories":[{"type":"git","url":"git@github.com:andzdroid/node-posterous.git"}],"dependencies":{},"main":"index","engines":["node"],"readme":"# node-posterous\nA NodeJS library for working with the posterous API.\n\n## Installation\n`npm install posterous`\n\n## Usage\nCreate the Posterous object with a posterous username/password to start using the API methods.\n\nThen call the `auth` method to fetch the user's API token.\n\n    var Posterous = require('posterous');\n\n    var posterous = new Posterous('user', 'pass');\n\n    //First call auth to get the API token\n    posterous.auth(function (err, result) {\n      if (err) {\n        console.error('Could not fetch API token!');\n      }\n\n      //API token fetched, you can now use all the API methods!\n      //See the tests folder for examples of the library in action!\n    });\n\n## Methods\n`get(api name, [args,] options, callback)`\n\nThis makes GET request to the API endpoint specified by `api name`.\n\nSome API endpoints require arguments such as a site ID, or post ID, and these should be passed as the parameters after the api name.\n\nThe `options` parameter is a dictionary used for POST and PUT requests, where you will want to include body data. For more info on which options are available to each type of request, see the [Posterous API docs](http://posterous.com/api). If there are no options, you must pass `null` to the function.\n\nThe callback function will be used to return error messages or request results.\n\nThe same applies to the following functions for different request methods:\n\n`post(api name, [args,] options, callback)`\n\n`put(api name, [args,] options, callback)`\n\n`del(api name, [args,] options, callback)`\n\n### auth(callback)\n`auth` will fetch the API token and save it to the Posterous object for future method calls. After you call auth, you don't need to do anything yourself with the API token.\n\nThe callback for `auth` is slightly different: `result` will contain the API token directly as a string.\n\n__auth should be called before any other API requests, except for public APIs.__\n\n\n## Callbacks\nAll API methods have the same callback:\n\n`err` - contains the error message if there was an error, or null otherwise.\n\n`results` - contains the results of the API call, see the [Posterous API](http://posterous.com/api) for more info.\n\n\n# APIs\n## Users\n### User (GET)\nGet the current user's information.\n\n    posterous.get('User', null, function (err, result) {\n      //Use result here\n      console.log(result.nickname);\n    });\n\n### Users (POST)\nCreate a new user (only for platform users of Posterous).\n\n## Subscriptions\n### Subscriptions (GET)\nThe user's current subscriptions.\n\n    //Fetch the second page of subscriptions\n    posterous.get('Subscriptions', {page: 2}, function(err, result) {\n      //Use result here\n    });\n\n### SubscriptionPosts (GET)\nThe posts from the user's subscribed sites.\n\n## Sites\n### Sites (GET, POST)\nList the user's Posterous sites, or create new sites.\n\n    var options = {\n      'site[hostname]': hostname,\n      'site[name]': 'My Posterous Site',\n      'site[is_private]': 'false'\n    }\n    \n    posterous.post('Sites', options, function(err, result) {\n      //Check result to make sure the site was created\n    });\n\n### Site (GET, PUT, DELETE)\n__Args:__ site ID\n\nGet a single Posterous site, update it, or delete it.\n\n    posterous.del('Site', site_id, null, function(err, result) {\n      //Use result here\n    });\n\n### Photos (GET)\n__Args:__ site ID\n\nGet 20 random photos from the user's sites.\n\n### Subscribe (GET)\n__Args:__ site ID\n\nSubscribe the current user to a site.\n\n### Unsubscribe (GET)\n__Args:__ site ID\n\nUnsubscribe the current user from a site.\n\n### HeaderImage (POST, DELETE)\n__Args:__ site ID\n\nUpload a new header image, or delete it.\n\n## Site Profiles\n### SiteProfile (GET, POST, PUT, DELETE)\n__Args:__ site ID\n\nGet, create, update, delete a site's profile.\n\n### SiteProfileImage (PUT, DELETE)\n__Args:__ site ID\n\nUpload or delete a site's profile image.\n\n## Site Tags\n### Tags (GET)\n__Args:__ site ID\n\nGet the list of tags for a site.\n\n## Site Contributors\n### Contributors (GET, POST)\n__Args:__ site ID\n\nGet the list of contributors, or add a new contributor.\n\n### Contributor (DELETE)\n__Args:__ site ID, contributor ID\n\nDelete a contributor from a site.\n\n## Site Subscribers\n### Subscribers (GET, POST)\n__Args:__ site ID\n\nGet a list of subscribers to a site, or add a new subscriber (Platform users only).\n\n### Subscriber (DELETE)\n__Args:__ site ID, subscriber ID\n\nRemove a subscriber from a site.\n\n## External Autopost Sites\n### ExternalSites (GET)\n__Args:__ site ID\n\nGet a list of external autopost sites.\n\n### ExternalSite (GET, DELETE)\n__Args:__ site ID, external site ID\n\nGet or delete a single external autopost site.\n\n## Site Theme\n### Theme (GET, POST)\n__Args:__ site ID\n\nGet the theme for a site, or create a new theme.\n\n## Posts\n### AllPosts (GET)\nGet a list of public posts.\n\n### Posts (GET, POST)\n__Args:__ site ID\n\nGet a list of posts belonging to a site, or create a new post.\n\n### Post (GET, PUT, DELETE)\n__Args:__ site ID, post ID\n\nGet a single post, update it or delete it.\n\n### PublicPosts (GET)\n__Args:__ site ID\n\nGet a list of a site's public posts.\n\n### PostPhotos (GET)\n__Args:__ site ID, post ID\nGet photos from a post.\n\n### PostVideos (GET)\n__Args:__ site ID, post ID\nGet videos from a post.\n\n### PostAudioFiles (GET)\n__Args:__ site ID, post ID\n\nGet audo files from a post.\n\n## Post Comments\n### Comments (GET, POST)\n__Args:__ site ID, post ID\n\nGet a list of comments from a post, or create a new comment.\n\n### Comment (GET, PUT, DELETE)\n__Args:__ site ID, post ID, comment ID\n\nGet a single comment from a post, update it, or delete it.\n\n## Post Likes\n### Likes (GET, POST)\n__Args:__ site ID, post ID\n\nGet a list of likes for a post, or add a new like.\n\n### Like (GET, DELETE)\n__Args:__ site ID, post ID, like ID\n\nGet a single like for a post, or delete it.\n\n## Pages\n### Pages (GET, POST)\n__Args:__ site ID\n\nGet a list of a site's pages, or create a new page.\n\n### Page (GET, PUT, DELETE)\n__Args:__ site ID, page ID\n\nGet a single page, update it, or delete it.\n\n## Link Categories\n### Categories (GET, POST)\n__Args:__ site ID\n\nGet a list of categories, or create a new category.\n\n### Category (GET, PUT, DELETE)\n__Args:__ site ID, category ID\n\nGet a single category, update it, or delete it.\n\n### MoveCategory (PUT)\n__Args:__ site ID, category ID\n\nMove a category to a new position.\n\n## Links\n### Links (GET, POST)\n__Args:__ site ID, category ID\n\nGet a list of links, or create a link in the category.\n\n### Link (GET, PUT, DELETE)\n__Args:__ site ID, category ID, link ID\n\nGet a single link, update it, or delete it.\n\n### MoveLink (PUT)\n__Args:__ site ID, category ID, link ID\n\nMove a link to a new position.\n","_id":"posterous@1.1.0","dist":{"shasum":"bb80df2e45cd09c4d5f1d416887c152111b140af","tarball":"https://registry.npmjs.org/posterous/-/posterous-1.1.0.tgz","integrity":"sha512-AksC4M47JLDum573JKKXRTjnZ/R6L+HC3NybkzDDSbtUfGelQaxdXc1DnQGmZRoNOwWDAkZBWbg8H8krS0IqaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHb3GiVVdttnz0S4AL0bge+R9Z8TbT4awlIVGwCr7QYAIhAJ3OGConb9Dvp6wp9iM6Cpe9L65D8RbJLajE580Zp8lW"}]},"maintainers":[{"name":"andz","email":"zegg90@gmail.com"}]}},"maintainers":[{"name":"andz","email":"zegg90@gmail.com"}],"time":{"modified":"2022-06-24T11:16:07.484Z","created":"2011-06-17T20:06:23.887Z","1.0.0":"2011-06-17T20:06:24.599Z","1.1.0":"2013-01-02T11:12:17.093Z"}}