0

Hello everyone !

I'd like to have a script that downloads the first PNG image that you find on google when you type a keyword taken in argument by the script.

I know that I can find PNG images if I type "filetype:png" after a research on Google Images, but I don't know how to do the rest.

Maybe something with wget ? Maybe it would be easier using Python ?

The very purpose of this is to have a script that locks my computer with a completly random image everytime that I lock it with a specific shortcut.

Thanks a lot for your help and answers ! Have a good day !

  • 2
    I hate potentially over-moderating first posts, but I believe this may be too broad as there really isn't a specific question here as there are probably many ways to solve this (Google APIs, Curl, Wget) and many languages which you might use to implement those solutions. Start working on it and when you get stuck with a specific question like "I'm trying to wget a google image search result, but the response is always a 404" or similar. – JNevill Mar 20 '18 at 20:28

1 Answers1

0

The best and possibly only decent way to do this is to use google's APIs which require an account.

See this related issue: Google image search says api no longer available

See the top answer...

Google's custom search API appears to allow you to retrieve image search results and fetch the images as well.

Jason Slobotski
  • 1,386
  • 14
  • 18