Requesting Google API directly from Max ?

Julien Bayle's icon

Hi there,
a student of mine wants to request Google API.

Basically, we know how to do that by using JS and a browser, but we want to catch a picture in the page.
In order to "intercept" this, Max or Processing driving the process would be better.

Did someone already make that with JS inside Max ? I mean, connecto to Custom Search API and parse results ?

Another option would be to request the basic search URL, and to parse the results. But I cannot have any result by using jit.uldl for that.

Any idea would be very appreciate.

Best,
Julien

Jan M's icon

Hi Julien, i am not really familiar with the google api. is REST or SOAP? in any case it sounds like the new maxurl object could do the job.
jan

(karrrlo)'s icon

Depending on what needs to be done, you can use Curl commands with the [shell] object.

nealriley's icon

I would suggest the newly created [maxurl] object, which stores resulting pages/etc. in a max dict object. From there you could parse the image out? Another option would be to return a json object from a google image search, which you could easily parse, download and write to disk.

Julien Bayle's icon

thanks for your answers.

problem is the google api (custom search new way)
I'd like to use it inside js in max.
but maybe this is the wrong way and pure curl/maxurl download + parsing can do the job.

nealriley's icon

Passing maxurl >> Dictionary >> Js object might be a middle ground? There's a relatively simple method for pulling data from a named Dict object into the js object here: https://cycling74.com/wiki/index.php?title=Parsing_Dict_files_to_Javascript_objects

Jan M's icon

check out the helpfile for maxurl. you can now make http requests directly from js.