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:

  1. as may have stated, google custom search best option. indeed, cannot use js code have. once have app key , cx code in 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=99 

    this going return json-based response image urls wrapped onto cse_image property. go ahead, call ajax requests , map responses html.

    also, possible build url dinamically through forms apis explorer.

  2. 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.

  3. you can explore additional options other google ones (once has limitation of 100 queries per day free. after $5 per 1,000 queries.):

  4. 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

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -