Permalink
Browse files

added example usage without auth endpoint

  • Loading branch information...
1 parent b09227f commit 2fac9c1a2b06e67a4846c7869e798e88f9141fa8 @tonyto tonyto committed Aug 16, 2011
Showing with 36 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +8 −0 examples/config/index.sample.js
  3. +13 −0 examples/spec_site.js
  4. +13 −0 examples/spec_user.js
View
@@ -1,3 +1,5 @@
*.swo
*.swp
tests/config/index.js
+*.log
+
@@ -0,0 +1,8 @@
+//To run the tests, rename this file to index.js
+//and fill in your posterous account details
+
+module.exports = {
+ user: '',
+ pass: ''
+ , api_token: ''
+};
View
@@ -0,0 +1,13 @@
+var Posterous = require('../index');
+var config = require('./config');
+
+var posterous = new Posterous(config.user, config.pass, config.api_token);
+
+console.log('Fetching user details...');
+posterous.get('Sites', {site_id: 'tonyto85'}, function(err, result) {
+ console.error(!err, 'An error occurred: ' + err);
+
+ console.log(result, 'Did not retrieve site information');
+
+ console.log(result);
+});
View
@@ -0,0 +1,13 @@
+var Posterous = require('../index');
+var config = require('./config');
+
+ var posterous = new Posterous(config.user, config.pass, config.api_token);
+
+ console.log('Fetching user details...');
+ posterous.get('User', null, function(err, result) {
+ console.error(!err, 'An error occurred: ' + err);
+
+ console.log(result, 'Did not retrieve user information');
+
+ console.log(result);
+ });

0 comments on commit 2fac9c1

Please sign in to comment.