https://github.com/cosmitar/imvdb-client
IMVDb API client written in ES6. An easy to use SDK for IMVDb Web API endpoints. https://imvdb.com/developers/api/
https://github.com/cosmitar/imvdb-client
Last synced: about 1 year ago
JSON representation
IMVDb API client written in ES6. An easy to use SDK for IMVDb Web API endpoints. https://imvdb.com/developers/api/
- Host: GitHub
- URL: https://github.com/cosmitar/imvdb-client
- Owner: Cosmitar
- Created: 2015-11-17T03:46:12.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-18T15:38:47.000Z (over 10 years ago)
- Last Synced: 2025-04-04T02:51:06.445Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# IMVDb Web API Client | ES6
Client written in ECMAScript 6. An easy to use SDK for [IMVDb Web API](https://imvdb.com/developers/api/) endpoints.
## Simple usage
Find (by id)
```javascript
Video.find( '121779770452' )
.then( ... );
```
Search videos by keyword
```javascript
Video.where( 'aerosmith' )
.then( ... );
```
Get Entity item by id
```javascript
Entity.find( 634 )
.then( ... );
```
Find a video with includes
```javascript
Video.find( '121779770452', ['credits','sources','featured','popularity'] )
.then( ... );
```
## Examples
*Search videos with pagination options*
```javascript
let config = {
per_page: 10,
page: 2
};
//keep this var on a scope reachable from UI
let currentPage;
Video.where( 'Abba Mamma Mia', config )
.then( page => {
//first time that I've got a page.
//store the page into a scope to access it from next-click-handler event
currentPage = page;
drawVideosList( page.elements );//draw your list here
});
let onClickNextHandler = () => {
currentPage.next()
.then( page => {
//currentPage automatically updates with the last page recovered.
drawVideosList( page.elements );//draw your list here
})
}
```
*Get first video from a search and draw its artists*
```javascript
Video.where( 'uptown funk' )
.then( page => {
let video = page.firstElement();
drawArtistList( video.artists );
});
```
*Find and Entity by id*
```javascript
Entity.find( 634 )
.then( entity => {
drawEntity( entity );
});
```
*Search a Video and get its featured artists*
```javascript
Video.where( 'Lady Marmalade', ['featured'] )
.then( page => {
let video = page.firstElement();
drawArtistList( video.featured_artists );
});
````
No more features by now until IMVDb support replies about the API development continuity. Some server-side issues arose in this development process.
## Development
```git clone git@github.com:Cosmitar/imvdb-client.git```
```npm install```
```gulp watch```
Open the localhost:3000/demo/index.html and look for console logs
##Installation
IMVDb discourages production use because API is still in beta.
##License
MIT