From b203615c9478d119265533f07a14fb618a7f8cfa Mon Sep 17 00:00:00 2001 From: grib Date: Fri, 1 Apr 2022 23:57:41 +0200 Subject: [PATCH] Upload files to '' --- main.riot | 44 +++++++++++++++++++++++++++++++++++++++ search.riot | 17 +++++++++++++++ service.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sorting.riot | 24 +++++++++++++++++++++ style.css | 3 +++ 5 files changed, 147 insertions(+) create mode 100644 main.riot create mode 100644 search.riot create mode 100644 service.js create mode 100644 sorting.riot create mode 100644 style.css diff --git a/main.riot b/main.riot new file mode 100644 index 0000000..9b17ec8 --- /dev/null +++ b/main.riot @@ -0,0 +1,44 @@ +
+

{props.title}

+

Loading

+

Résultats {state.message}

+ + + + + + +
CINEMAMA
+
\ No newline at end of file diff --git a/search.riot b/search.riot new file mode 100644 index 0000000..6e22268 --- /dev/null +++ b/search.riot @@ -0,0 +1,17 @@ + + + + + + diff --git a/service.js b/service.js new file mode 100644 index 0000000..42e1b60 --- /dev/null +++ b/service.js @@ -0,0 +1,59 @@ +function makeServiceajax(){ + let urlBase = "https://api.themoviedb.org/3/" + let apiKey = "3501a3f71bbe8a2f282d299a14602396" + + let service = { + searchMovie, doRequest, discover, detailsMovie, sorting, trading, getGenres + }; + + function doRequest(search){ + return fetch(urlBase+"search/movie?api_key"+apiKey+"&language=fr&query"+search+"&page=1") + .then(response => response.json()) + .then(data => data) + } + + function searchMovie(search){ + return fetch(urlBase+"search/movie?api_key="+apiKey+"&language=fr&query="+search+"&page=1") + .then(response => response.json()) + .then(data => data) + } + + function discover(){ + return fetch(urlBase+"discover/movie?api_key="+apiKey+"&language=fr&app&page=1") + .then(response => response.json()) + .then(data => data) + } + + + function detailsMovie(movie_id){ + return fetch(urlBase+"discover/movie"+movie_id+"?api_key="+apiKey+"&language=fr&app&page=1") + .then(response => response.json()) + .then(data => data) + } + + function genres(){ + return fetch(urlBase+"discover/movie?api_key="+apiKey+"&language=fr&app&page=1") + .then(response => response.json()) + .then(data => data) + } + + function getGenres(){ + return fetch(urlBase+"genre/movie/list?api_key="+apiKey+"&language=fr&app&page=1") + .then(response => response.json()) + .then(data => data) + } + + function sorting(type){ + return fetch(urlBase+"discover/movie/?api_key="+apiKey+ type +"&language=fr&app&page=1") + .then(response => response.json()) + .then(data => data) + } + + function trading(){ + return fetch(urlBase + "trending/all/day?api_key=" + apiKey + "&language=fr&page=1") + .then(response => response.json()) + .then(data => data) + } + + return service +} \ No newline at end of file diff --git a/sorting.riot b/sorting.riot new file mode 100644 index 0000000..ded1526 --- /dev/null +++ b/sorting.riot @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..c0cdcd4 --- /dev/null +++ b/style.css @@ -0,0 +1,3 @@ +h3{ + size: 20px; +} \ No newline at end of file