An open API service indexing awesome lists of open source software.

https://github.com/johnnythetank/angular-tumblr-api-factory

AngularJS factory for Tumblr JSON REST API requests
https://github.com/johnnythetank/angular-tumblr-api-factory

angular angular-factory angularjs api factory tumblr tumblr-api

Last synced: 11 months ago
JSON representation

AngularJS factory for Tumblr JSON REST API requests

Awesome Lists containing this project

README

          

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

[![npm version](https://badge.fury.io/js/angular-tumblr-api-factory.svg)](https://badge.fury.io/js/angular-tumblr-api-factory)
[![Bower version](https://badge.fury.io/bo/angular-tumblr-api-factory.svg)](https://badge.fury.io/bo/angular-tumblr-api-factory)

Author: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank))

## Usage

1. Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) 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](https://github.com/JohnnyTheTank/angular-tumblr-api-factory/zipball/master)
2. Add `jtt_tumblr` to your application's module dependencies.
3. Include dependencies in your HTML.
1. When using bower:
```html

```
2. When using npm:
```html

```
3. when using downloaded files
```html

```
4. Use the factory `tumblrFactory`

### factory methods

#### getInfo

```js
tumblrFactory.getInfoFromPage({
page:"",
api_key:"",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

#### getAvatar

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

#### getPosts
Get all parameters [here](https://www.tumblr.com/docs/en/api/v2#posts)
```js
// all parameters: https://www.tumblr.com/docs/en/api/v2#posts
tumblrFactory.getPostsFromPage({
page:"",
limit:"", // (optional) valid values: 0-20 | default: 20
type:"", // (optional) valid values: text, quote, link, answer, video, audio, photo, chat
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](https://github.com/JohnnyTheTank/angular-bandsintown-api-factory) - [dailymotion](https://github.com/JohnnyTheTank/angular-dailymotion-api-factory) - [facebook](https://github.com/JohnnyTheTank/angular-facebook-api-factory) - [flickr](https://github.com/JohnnyTheTank/angular-flickr-api-factory) - [footballdata](https://github.com/JohnnyTheTank/angular-footballdata-api-factory) - [github](https://github.com/JohnnyTheTank/angular-github-api-factory) - [openweathermap](https://github.com/JohnnyTheTank/angular-openweathermap-api-factory) - **tumblr** - [vimeo](https://github.com/JohnnyTheTank/angular-vimeo-api-factory) - [wikipedia](https://github.com/JohnnyTheTank/angular-wikipedia-api-factory) - [youtube](https://github.com/JohnnyTheTank/angular-youtube-api-factory)

## License

MIT