Closed zoeames closed 6 years ago
Comment by zoeames Monday Oct 16, 2017 at 04:56 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:53 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:02 GMT
We will be making a GET to /search/movie
https://api.themoviedb.org/3/search/movie?api_key=<<api_key>>&language=en-US&page=1&include_adult=false
Comment by zoeames Monday Oct 16, 2017 at 04:56 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:53 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:03 GMT
TMDB requires that we send an API key for every request. I have an API key from my account. I need to secure it so i will put it in db/apiKeys.json in an object that looks like:
{
"apiKeys": {
"tmdb": {
"apiKey": "##############"
}
}
}
I will then add this file to my .gitignore. To make it clear to users the structure they need for this file, I will create an db/apiKeys.example.json
{
"apiKeys": {
"tmdb": {
"apiKey": ""
}
}
}
I will nee to add instructions to my readme to get an API key and rename apiKeys.example.json to apiKeys.json.
Comment by zoeames Monday Oct 16, 2017 at 04:56 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:53 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:08 GMT
create javascripts/apiKeys.js
This file will have two functions:
module.exports = {retrieveKeys};
Comment by zoeames Monday Oct 16, 2017 at 04:56 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:53 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:11 GMT
create javascripts/tmdb.js This file will have 4 functions:
Comment by zoeames Monday Oct 16, 2017 at 04:56 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:53 GMT
Comment by zoeames Monday Oct 16, 2017 at 04:13 GMT
create javascripts/events.js
This file has 1 function
pressEnter - keypress event on document that checks if the enter key was pushed. if it was the enter key this function:
Story
As a user, when I search for a movie, I should see possible matches.
Acceptance Criteria
When the user types a movie into the search bar Then the user presses enter And the code should hit the TMDB api And the user should see the movies that TMDB returns.
Technical Resource
Use TMDB as your API.