Use javascript to get a random image from Google images

后端 未结 2 635
遇见更好的自我
遇见更好的自我 2020-12-24 08:17

I have this idea for my website that every time you visit the page, the background will be different. I want to get literally any picture from Google images and place it as

2条回答
  •  囚心锁ツ
    2020-12-24 08:53

    although not technically what was asked, this could help give some structure to the randomness -- you could compose a couple dictionaries, of verbs, nouns, adjectives.. and mad-lib it up with a random adjective-noun verbing, (ie, fat bulldog running) then query google with that search, and pick a random picture from the results. this way, you can potentially reduce the inappropriate results, and also allow selection of specific dictionaries based on themes the user has selected perhaps. (ie, changing the available nouns based on user's likes)

提交回复
热议问题