Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucbpz/tmdb-js
A simple JS object to call the API of TheMovieDB.
https://github.com/lucbpz/tmdb-js
Last synced: 7 days ago
JSON representation
A simple JS object to call the API of TheMovieDB.
- Host: GitHub
- URL: https://github.com/lucbpz/tmdb-js
- Owner: lucbpz
- License: mit
- Created: 2014-10-20T22:34:29.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-05T06:15:56.000Z (over 10 years ago)
- Last Synced: 2024-11-08T04:39:28.430Z (about 2 months ago)
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tmdb-js
=======A simple JS object to call the API of TheMovieDB.
Get Started
-----------First, insert the script into your HTML file :
```html```
Set your api_key on line 4.
(You can make calls to the API with SSL/TLS by modifying the uri to begin with https:// instead of http://)Test the script by making a simple call with the console :
```js
tmdb.call("/configuration", {},
function(e){
console.log("Success: "+e)
},
function(e){
console.log("Error: "+e)
}
)
```
It should always return a JSON object. If you get the error callback, then it's probably that you made a mistake in your api_key or in the url (first argument of tmdb.call).Usage
-----
```js
tmdb.call(url, params, success, error)
```
url (String) : The method you want to call, beginning with "/". [See all methods here](http://docs.themoviedb.apiary.io/ "Going to APIary.io")
params (Object) : Set your parameters here. Api_key is already included, no need to add it again ;) For example (calling method /search/movie) :
```json
{
"query": "The Hitchhiker's Guide to the Galaxy",
"year": 2005,
include_adult: false
}
```
success & error (Functions) : Callbacks with one argument to get the data, already parsed as JSON.