r/programmingrequests • • Jun 17 '18
Making this API code bring through more relevant data?
I have this code I have written here:
https://jsfiddle.net/dfwq57pz/
However the code does not bring up relevant/modern movies, it brings up random movies that I have never heard of, also I can't get it to skip the movies it does not find.
I wanted to do something like on this website:
https://www.randomlists.com/random-movies?qty=1&dup=false
But it is impossible to contact the owner, view the sites source code etc... I presume they have done it on the backend.
I am thinking I would need to do something as per:
https://developers.themoviedb.org/3/discover/movie-discover
However, when I try to amend my code in the above JSFiddle it does not work. An attempt as such can viewed here:
Overall to reiterate I want to:
Bring up more relevant movies like https://www.randomlists.com/random-movies?qty=1&dup=false and I think this is the right place possibly to look in the docs?: https://developers.themoviedb.org/3/discover/movie-discover
Make it skip movies where it finds missing data, e.g. no movie poster.
View all comments
Show parent comment
1
u/[deleted] Jun 17 '18
Thanks, but with this I only wanted to display 1 random result each time, it seems as though you have looped through all the results in order to display them on line 18, is that correct? So it would be say 50 pages of results rather than 1 actually, but actually only display 1 film in the DOM / on the HTML page, bit confused how to go about doing this, if you could show me how it would be much appreciated?