Ben allready bu soru için cevabı biliyorum, ama ben sadece merak, ben zaten onu soracağım.
Ben ürünleri bir csv dosyası ile gelen bir webshop'unu koşuyorum. Ben herhangi bir sorun olmadan tüm objectsng alabilirsiniz, tek şey görüntü ve resim yerleri veritabanı dökümü ile dışa olmasıdır. (Mükemmel heh asla) Bunu elle, sonra ben ilk etapta ne yaptığını yapmak, diyebilirsiniz, ama 200 ürün ve RSI sonra, ben vazgeçtim ve bunu yapmak için daha iyi daha verimli bir şekilde baktı.
Ben distribütör istediler ve ben herhangi birine sahip olan telif hakkı sorunları olmadan kendi amaçları için kendi görüntüleri kullanabilir.
Ben görüntülerin yere baktığımızda, url bu gibi görünüyor:
../img/i.php?type=i&file=1250757780.jpg
Herkes bu sorunun üstesinden nasıl bir fikir var mı?
Bir web sitesi kazıma için, ben bu kodu bulundu:
<?php
function save_image($pageID) {
$base = 'http://www.gistron.com';
//use cURL functions to "open" page
//load $page as source code for target page
//Find catalog/ images on this page
preg_match_all('~catalog/([a-z0-9\.\_\-]+(\.gif|\.png|\.jpe?g))~i', $page, $matches);
/*
$matches[0] => array of image paths (as in source code)
$matches[1] => array of file names
$matches[2] => array of extensions
*/
for($i=0; $i < count($matches[0]); $i++) {
$source = $base . $matches[0][$i];
$tgt = $pageID . $matches[2][$i]; //NEW file name. ID + extension
if(copy($source, $tgt)) $success = true;
else $success = false;
}
return $success; //Rough validation. Only reports last image from source
}
//Download image from each page
for($i=1; $i<=6000; $i++) {
if(!save_image($i)) echo "Error with page $i<br>";
}
?>
Nedense bu hata atıyor: sayfa 1, sayfa 2, vb hata ile hata