Awesome
angular-tumblr-api-factory is an angularjs module with a tumblr api factory.
Author: Jonathan Hornung (JohnnyTheTank)
Usage
- Install via either bower, npm or downloaded files:
bower install --save angular-tumblr-api-factory
npm install --save angular-tumblr-api-factory
- download angular-tumblr-api-factory.zip
- Add
jtt_tumblr
to your application's module dependencies. - Include dependencies in your HTML.
- When using bower:
<script src="bower_components/angular-tumblr-api-factory/dist/angular-tumblr-api-factory.min.js"></script>
- When using npm:
<script src="node_modules/angular-tumblr-api-factory/dist/angular-tumblr-api-factory.min.js"></script>
- when using downloaded files
<script src="angular-tumblr-api-factory.min.js"></script>
- 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
- docs: https://www.tumblr.com/docs/en/api/v2
- official api console: https://api.tumblr.com/console/calls/user/info
- unofficial api console: https://apigee.com/console/tumblr
More angular-api-factories
bandsintown - dailymotion - facebook - flickr - footballdata - github - openweathermap - tumblr - vimeo - wikipedia - youtube
License
MIT