Home

Awesome

angular-tumblr-api-factory is an angularjs module with a tumblr api factory.

npm version Bower version

Author: Jonathan Hornung (JohnnyTheTank)

Usage

  1. Install via either bower, npm or downloaded files:
    1. bower install --save angular-tumblr-api-factory
    2. npm install --save angular-tumblr-api-factory
    3. download angular-tumblr-api-factory.zip
  2. Add jtt_tumblr to your application's module dependencies.
  3. Include dependencies in your HTML.
    1. When using bower:
    <script src="bower_components/angular-tumblr-api-factory/dist/angular-tumblr-api-factory.min.js"></script>
    
    1. When using npm:
    <script src="node_modules/angular-tumblr-api-factory/dist/angular-tumblr-api-factory.min.js"></script>
    
    1. when using downloaded files
    <script src="angular-tumblr-api-factory.min.js"></script>
    
  4. Use the factory tumblrFactory

factory methods

getInfo

tumblrFactory.getInfoFromPage({
    page:"<PAGE_NAME>",
    api_key:"<YOUR_TUMBLR_API_KEY>",
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

getAvatar

tumblrFactory.getAvatarFromPage({
    page:"<PAGE_NAME>",
    size:"<AVATAR_SIZE>", // (optional) Valid values: 16, 24, 30, 40, 48, 64, 96, 128, 512
    api_key:"<YOUR_TUMBLR_API_KEY>",
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

getPosts

Get all parameters here

// all parameters: https://www.tumblr.com/docs/en/api/v2#posts
tumblrFactory.getPostsFromPage({
    page:"<PAGE_NAME>",
    limit:"<LIMIT>", // (optional) valid values: 0-20 | default: 20
    type:"<POST_TYPE>", // (optional) valid values: text, quote, link, answer, video, audio, photo, chat
    api_key:"<YOUR_TUMBLR_API_KEY>",
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

Tumblr JSON API

More angular-api-factories

bandsintown - dailymotion - facebook - flickr - footballdata - github - openweathermap - tumblr - vimeo - wikipedia - youtube

License

MIT