Grab images from another website, like pinterest -


im trying build images bookmarklet site pinterest, somehow of website doesnt grab image. works fine. additional information, use jquery wookmark grid templates.

here codes im use... dont know if right or used wrong method retrieve images. cheers guys in advance comment or help... appreciated.

-- html <ul id="tiles"></ul> <div id="loader">     <div id="loadercircle" style="display:none"></div> </div>  -- javascript <script type="text/javascript">     function loaddata() {         isloading      = true;         var link_pin   ='http://www.somewebsite.com';          $('#loadercircle').show();          $.ajax({             url: '<?php echo(base_url('index.php/home/pin_ajax'))?>',             datatype: 'json',             data: {link_pin:link_pin},             success: onloaddata         });     };      function onloaddata(data) {          isloading = false;         $('#loadercircle').hide();          var html = '';         var i=0, length=data.length, returns_data;          for(; i<length; i++) {             var link_foto = data[i];                   var newimg = new image();             newimg.src = link_foto;             var height = newimg.height;             var width  = newimg.width;              var image_click="image_clicks('"+link_foto+"')";              if (width >="200" && height >="200"){                 html += '<li onclick="'+image_click+'" id="image_'+i+'">';                     html += '<a>';                         html += '<div class="back_tristlist">';                             html += '<span class="hover-icon icon-text">&#128269;</span>';                             html += '<img src="'+link_foto+'">';                         html += '</div>';                     html += '</a>';                 html += '<div class="space_image"></div>';                 html += '</li>';             }         }          $('#tiles').append(html);          handler = $('#tiles li');         handler.wookmark(options);     }; </script>  -- php  public function pin_ajax(){     extract($_get);      $page = file_get_contents($link_pin);     error_reporting(0);     $doc = new domdocument();      @$doc->loadhtml($page);      $images = $doc->getelementsbytagname('img');      echo($images);     $_datas[]="";      foreach($images $image){         $raw_img_url = $image->getattribute('src');         $img_final_link = $raw_img_url;         $img_url = explode('http://www.', $raw_img_url);         $img_check = $img_url[1];          if($img_check==''){             $img_url = explode('http://', $raw_img_url);             $img_check = $img_url[1];             if($img_check!=''){ $img_check_error=1; }             if($img_check==''){ $img_check_error=2; }         }          $_datas[] = ($img_check);     }      $output = json_encode($_datas);     echo($output); } 


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -