Pulling an image from a website
Hi all,
I'd like to create a patch that gets the picture of the day from Wikipedia: http://en.wikipedia.org/wiki/Pic_of_the_day. I know that the general format of the url is http://en.wikipedia.org/wiki/Template:POTD/yyyy-mm-dd
I'm not familiar with the scripting necessary to fill in the rest of the details. First, I'd like Max to get 'today's date,' which I'm not sure how to do. Then I would stick the date in yyyy-mm-dd format on the end of the url message, which is not difficult. However, this leads to the page itself, and not the specific image. Is there a way to direct Max to the .jpg featured on the page without knowing its exact url location?
Any suggestions are appreciated.
Jay
How much have you tried yourself?
For the current date, there is the [date] object (as searching in the Max help told me in 2 minutes).
For crawling websites, there is jit.uldl (as searching on this forum told me in 4 minutes: https://cycling74.com/forums/find-pictures-from-internetsides)
But you will need a bit of intelligent parsing of the page contents to find out what the picture is called.
jit.uldl helpfile, in the subpatch. But you could probably do it with [regexp]. Here's today's file (and is a cool pic too)
so... use [regexp] to find
http://en.wikipedia.org/wiki/File:
then take the whole URL and load that page, or use jit.uldl to grab the .jpg.
Thanks guys... Will get started on this right away!