Forums > MaxMSP

Python / Regex coding advice required…

March 5, 2010 | 5:39 pm

I’m attempting to make a patch within Max that enables the user to type in a search argument, after which the patch then returns & displays an image from google images relating to the argument.

I believe the best way to do this is to use Python & the Py /Pyext objects, though I’ve never used python before. I’ve also been informed that regex would haveto be used within the code in order to extract the the required data from the google image results source.

I’d appreciate any help or advice from anyone out there with experience in Python &/or using regex operations.

Alternatively, if anyone could suggest another solution that doesn’t involve Python, please do.

Thanks,
Matt.


March 5, 2010 | 6:45 pm

you could do this with python, or you could do it in javascript, or you could do it in java with MXJ, and yes, you can do it without any of them (in "pure max") utilizing jit.uldl.

the javascript method is a little less obvious than the others since there’s no "download this" function. in a little while i’ll attach something to this thread that i wrote recently to do it with jit.uldl in the background.


March 5, 2010 | 7:32 pm

check it out. code should be attached.

Attachments:
  1. jscurl.zip

March 5, 2010 | 7:33 pm

let’s try that again.

Attachments:
  1. jscurl.zip

March 5, 2010 | 10:33 pm

You could also use [jweb] where you can display the google homepage and just use that. I would probably still go for the [jit.uldl] option though. If you look in the [jit.str.regexp] help file there’s a good examples of downloading images from a website.

lh


March 6, 2010 | 2:46 am

That’s excellent, thanks alot! Shall look into all of the above.

Cheers,
Matt.


Viewing 6 posts - 1 through 6 (of 6 total)