Home Development of Websites Guess the movie from the trailer

Guess the movie from the trailer

by admin

Guess the movie from the trailer !
Looking for inspiration in the creations of the notorious web development contest 10k.aneventapart.com first touched upon by the author in past article , it was observed such an uncomplicated application The brief point is to identify the year of release of the film by its trailer. The idea is simple, interesting and at least one more simple game app can be made out of it. You want more details and/or you didn’t read the title of the article carefully? – Well, welcome under the hood.
It is possible to guess various things from a movie trailer–the director, the year of release, the full title of the work, etc. It is about guessing the name of the movie by its trailer will be discussed in this article. As a rule, the name of the movie does not appear at the beginning of the trailer, which creates the preconditions for the correct functioning of our application. To simplify the user’s life, we will not force him to enter any data in the text form manually – let him choose the right answer, for example, from three options.

How does it work?

The genius of the contest 10k.aneventapart.com is that the application that claims to win must be small and functional at the same time, otherwise it has no chance. One of the solutions to this contradiction is the use of different APIs which helps us kill several birds with one stone – no big data storage inside the client application and extension of the functionality by external queries only. The application used as a basis for our service works exactly this way. Let’s follow its example.
First, we generate a random number (year) within the range specified in the script (e.g., from 1950 to 2011). Then this year is substituted in query.yahooapis.com, which, in particular, allows you to parse pages with a list of movie titles linked to a certain year. This is how the movie data is stored in Wikipedia, for example. (It should be noted that this system is not flexible and depends on the format and HTML markup of the parsed resource. This is the price you pay for using third-party resources to load their data into your applications).
Having found enough movie titles, we choose one random one that corresponds to the correct movie title and two confusing ones. – Now you can search for the corresponding trailer on YouTube. Output this information to the user.
A warning about possible flaws – the application is experimental and not remarkable for its exquisite design, guessing by Russian trailers also leaves much to be desired due to the relatively small number of Russian trailers in general and on YouTube in particular. This is especially noticeable for old movies.
If somebody needs javascript sources in uncompressed form – on demand in comments or in private, I’ll give source code "in studio".
Guess the movie !

You may also like