Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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

angular angular-factory angularjs dailymotion dailymotion-api factory

Last synced: 13 days ago
JSON representation

AngularJS factory for Dailymotion JSON REST API requests

Awesome Lists containing this project

README

        

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

[![npm version](https://badge.fury.io/js/angular-dailymotion-api-factory.svg)](https://badge.fury.io/js/angular-dailymotion-api-factory)
[![Bower version](https://badge.fury.io/bo/angular-dailymotion-api-factory.svg)](https://badge.fury.io/bo/angular-dailymotion-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-dailymotion-api-factory`
2. `npm install --save angular-dailymotion-api-factory`
3. download [angular-dailymotion-api-factory.zip](https://github.com/JohnnyTheTank/angular-dailymotion-api-factory/zipball/master)
2. Add `jtt_dailymotion` 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 `dailymotionFactory`

### factory methods

#### getVideos

##### getVideosFromUserById
Get all parameters [here](https://developer.dailymotion.com/tools/apiexplorer#/user/videos/list)
```js
// all parameters: https://developer.dailymotion.com/tools/apiexplorer#/user/videos/list
dailymotionFactory.getVideosFromUserById({
id:"",
search:"", // (optional)
limit:"", // (optional) valid values: 1-100 | default: 10
}).then(function(_data){
//on success
}).catch(function (_data) {
//on error
});
```

##### getVideosFromChannelById
Get all parameters [here](https://developer.dailymotion.com/tools/apiexplorer#/channel/videos/list)
```js
// all parameters: https://developer.dailymotion.com/tools/apiexplorer#/channel/videos/list
dailymotionFactory.getVideosFromChannelById({
id:"",
search:"", // (optional)
limit:"", // (optional) valid values: 1-100 | default: 10
}).then(function(_data){
//on success
}).catch(function (_data) {
//on error
});
```

##### getVideosFromPlaylistById
Get all parameters [here](https://developer.dailymotion.com/tools/apiexplorer#/playlist/videos/list)
```js
// all parameters: https://developer.dailymotion.com/tools/apiexplorer#/playlist/videos/list
dailymotionFactory.getVideosFromPlaylistById({
id:"",
limit:"", // (optional) valid values: 1-100 | default: 10
}).then(function(_data){
//on success
}).catch(function (_data) {
//on error
});
```

##### getVideosByParams
Get all parameters [here](https://developer.dailymotion.com/tools/apiexplorer#/video/list)
```js
// all parameters: https://developer.dailymotion.com/tools/apiexplorer#/video/list
dailymotionFactory.getVideosByParams({
search:"", // (optional)
tags:"", // (optinal)
limit:"", // (optional) valid values: 1-100 | default: 10
}).then(function(_data){
//on success
}).catch(function (_data) {
//on error
});
```

## Dailymotion JSON API

* docs: https://developer.dailymotion.com/api
* api explorer: https://developer.dailymotion.com/tools/apiexplorer

## More angular-api-factories
[bandsintown](https://github.com/JohnnyTheTank/angular-bandsintown-api-factory) - **dailymotion** - [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](https://github.com/JohnnyTheTank/angular-tumblr-api-factory) - [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