This project presents a simple web page that allows you to play a "Random Movie Generator" game.
-
Click the "Fetch a random movie" button to fetch a random popular movie title from The Movie Database (TMDb) API. The movie title will be displayed as emoji on the page.
-
Guess the movie title by typing it into the input field and clicking the "Check" button.
-
If your guess matches the movie title, an alert box will display "Correct! The actual movie name is [movie title]." If your guess does not match the movie title, an alert box will display "Incorrect! Try again."
- HTML: for defining the structure and content of the web page
- CSS: for defining the visual styling of the page elements
- JavaScript: for defining the behavior of the page elements and handling the communication with the TMDb and OpenAI API
- The Movie Database (TMDb) API: to fetch the list of popular movies
- OpenAI API: to convert movie title to an Emoji
To run the game on your local machine, you will need to have a web server installed, you can use http-server for this.
- Clone the repository
git clone https://github.com/lettaz/MovieEmoji.git
- Navigate to the project directory
cd MovieEmoji
-
Open Index.html with your web browser
-
Click on the "Fetch a random movie" button to start playing the game
The code uses apiKey
variable to interact with TMDb API, this variable is set to ######MYAPIKEY######
, which is an example key and may not work in this code. It would be recommended to use your own key which you can get by signing up on TMDb website and OPEN AI
This code is a simple game that allows the user to guess a movie title and check their answer, The use of API from TMDb and OpenAI to get a random movie title, and convert it to an emoji, makes the game more interactive. The user can run it on local machine and interact with it by providing input in the given field.