Coder Social home page Coder Social logo

johnnythetank / angular-tumblr-api-factory Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 12 KB

AngularJS factory for Tumblr JSON REST API requests

License: MIT License

JavaScript 84.10% HTML 15.90%
angular angular-factory angularjs api factory tumblr tumblr-api

angular-tumblr-api-factory's Introduction

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

angular-tumblr-api-factory's People

Contributors

johnnythetank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

switch13

angular-tumblr-api-factory's Issues

chore

  • replace .success() and .error() with .then() and .catch()
  • create non-minified dist file
  • create npm reference

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.