Can someone please help with API for IMDb or OMDB?
Posted: 23 May 2022, 15:05
I'm having a really hard time getting this to work, and I feel like I'm in over my head. It's disturbing and frustrating because I can usually figure stuff out. My college Fortran courses are useless, and just like AHK, it's been years since I worked with it and therefore I've forgotten most of both languages, just like I forgot most of my 2 years of Spanish, "No comprende." I can achieve my goals (a small bit of movie info) in a ridiculous, convoluted matter (opening an actual browser and counting characters to find the words I need), but now I'm pissed and I want to do it right. I've spent way too much time on this to give up and do it wrong. I don't care if we use JSON or XML, but I've been trying JSON. Oh, and I have tried searching other posts for help.
Here's a link to the relevant page, where you don't even need a key if you can settle for one string of text (but I've been using a key). Feel free to use my key if you decide to help. They're free for up to 1,000 queries per month, and I may need like 10 or 20 per month.
https://omdbapi.com
Here's what I've been trying, and since I sort of gave up I don't even understand most of it. Some of it is copied from someone else doing a weather API, and I get error messages starting in that 3rd line:
[Mod edit: [code][/code] tags added.]
I've also tried a little with Javascript, but I'm having no luck there either. This is probably because I don't know what I'm doing. Any help would be greatly appreciated.
PS. Also if you could help with a quick bit of parsing the info and extracting only certain things, like, actor, year, etc., that would be wonderful and it would make you a good person, and I'm sure you would end up going to Heaven, assuming you believe a Heaven exists.
Here's a link to the relevant page, where you don't even need a key if you can settle for one string of text (but I've been using a key). Feel free to use my key if you decide to help. They're free for up to 1,000 queries per month, and I may need like 10 or 20 per month.
https://omdbapi.com
Here's what I've been trying, and since I sort of gave up I don't even understand most of it. Some of it is copied from someone else doing a weather API, and I get error messages starting in that 3rd line:
Code: Select all
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HTTP.Open("GET", http//omdbapi.com/?apikey=<myAPIkey>&t=prisoners+of+the+ghostland)
HTTP.SetRequestHeader("Accept","*.*")
HTTP.SetRequestHeader("Accept-Encoding","deflate")
HTTP.SetRequestHeader("Accept-Language","en-US")
HTTP.SetRequestHeader("Connection","keep-alive")
HTTP.SetRequestHeader("Host","omdbapi.com")
HTTP.SetRequestHeader("Upgrade-Insecure-Requests","1")
HTTP.SetRequestHeader("User-Agent","Firefox/99.0")
HTTP.Send()
Clipboard := HTTP.ResponseText
MsgBox, 0, , CLIPBOARD = %clipboard%
I've also tried a little with Javascript, but I'm having no luck there either. This is probably because I don't know what I'm doing. Any help would be greatly appreciated.
PS. Also if you could help with a quick bit of parsing the info and extracting only certain things, like, actor, year, etc., that would be wonderful and it would make you a good person, and I'm sure you would end up going to Heaven, assuming you believe a Heaven exists.