javascript - How to load google images within my site using api? -
i trying implement what on page having error on console:
www.google.com/jsapi?key=abqiaaaar19eul_kzsycbnymjsjbphss8zuuzs-phhbad9skttjftv728xq8ncr0mwfbq0ita4r2wzc7rtuwuq:22 parser-blocking, cross-origin script, https://www.google.com/uds/?file=search&v=1&output=nocss%3dtrue, invoked via document.write. may blocked browser if device has poor network connectivity.
i tried follow this answers on google image search says api no longer available.
i trying display images based on given string using jquery or javascript , ajax.
note: set own key , cx
yes, api no longer available , won't able use anymore. however, still have options:
as may have stated,
google custom searchbest option. indeed, cannot use js code have. once haveapp key,cx codein hands, thing have call request proper params handling response. let's see:https://www.googleapis.com/customsearch/v1?q=java&cx=your_cx_code&key=your_app_key&num=1&start=99this going return json-based response image urls wrapped onto
cse_imageproperty. go ahead, call ajax requests , map responses html.also, possible build url dinamically through forms apis explorer.
cx generator, itself, gives generated js code pre-formatted html , style web searching:
(function() { var cx = 'your_cx_code'; var gcse = document.createelement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(gcse, s); })(); <gcse:search></gcse:search>note: remember can add basemaps based on domains, e.g
*.com,*.net, etc. instead of searching specific websites.you can explore additional options other google ones (once has limitation of 100 queries per day free. after $5 per 1,000 queries.):
- riffsy api: http://api.riffsy.com/#start
 - gallery search imgur api: http://api.imgur.com/endpoints/gallery#gallery-search
 - ababeen api: http://api.ababeen.com/
 
- or, if still wanna go google api, can try 
hubot scripts, interacts google custom search api more productivity, once sets lot of things us: https://github.com/hubot-scripts/hubot-google-images/ 
Comments
Post a Comment