Hatena::Fotolife API wrapper for Node.js (unofficial)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
gulpfile.coffee
index.js
package.json

README.md

hatena-fotolife-api

Hatena::Fotolife API wrapper for Node.js (unofficial)

Installation

$ npm install hatena-fotolife-api

Usage

See examples/.

Coding style (Callback/Promise)

Callback style

var fotolife = require('hatena-fotolife-api');

var client = fotolife({ type: 'wsse', username: 'username', apikey: 'apikey' });
var options = { title: 'bouzuya\'s icon', file: './bouzuya.png' };

client.create(options, function(err) {
  if (err) {
    console.error(err);
  } else {
    console.log('uploaded');
  }
});

Promise style

var fotolife = require('hatena-fotolife-api');

var client = fotolife({ type: 'wsse', username: 'username', apikey: 'apikey' });
var options = { title: 'bouzuya\'s icon', file: './bouzuya.png' };

client.create(options).then(function() {
  console.log('uploaded');
}, function(err) {
  console.error(err);
});

Configuration (WSSE/OAuth)

WSSE

See "How to use Hatena WSSE".

OAuth

See "How to use Hatena OAuth".

Application scope is "read_private" or "write_private" or both.

var fotolife = require('hatena-fotolife-api');

var client = fotolife({
  type: 'oauth',
  consumerKey: 'consumerKey',
  consumerSecret: 'consumerSecret',
  accessToken: 'accessToken',
  accessTokenSecret: 'accessTokenSecret'
});

// ...

API Docs

See Hatena::Fotolife Atom API, test/ and examples/.

Development

npm run

License

MIT

Author

bouzuya <m@bouzuya.net> (http://bouzuya.net)

Badges

Build Status Dependencies status Coverage Status