Title ve resimleri en basit bu şekilde alabilirsin. Kafan karışmasın diye desenlemeyi karıştırmadım.
Kaydetmede title'ı resim adı olarak eklemeyi sormuşsun sanırım onuda gösterdim.
<?php
$uploadDir = "";
$site = "SİTE ADI"; //Ör: www.hedehödü.com -- http:// ve sonunda / olmamalı
$fileGet = file_get_contents($site);
preg_match_all('~<div class="readmore"><a href="(.*?)">~si',$fileGet,$getData);
//print_r($getData);
for($i=0; $i<count($getData[1]); $i++):
$content = file_get_contents($getData[1][$i]);
preg_match('~<title>(.*?)</title>~i',$content,$contentTitle);
preg_match('~src="http://' . $site . '/wp-content/uploads/(.*?)"~si',$content,$contentImage);
$seoTitle = titleReplace($contentTitle[1]);
for($i=0; $i<count($allImages[1]); $i++):
if(is_dir($uploadDir)):
$imageNewName = $seoTitle . ".jpg";
$copy = copy( 'http://' . $site . '/wp-content/uploads/' . $contentImage[1] ,$uploadDir . "/" . $imageNewName );
if($copy === false) die ( $allImages[1][$i] . " - kaynağındaki resim kopyalanamadı.");
echo 'http://' . $site . '/wp-content/uploads/' . contentTitle[1] . " - kaynağındaki resim [" . $imageNewName . "] adıyla sunucuya kopyalandı<br />";
else:
echo $uploadDir . " - Dizini bulunamadı";
endif;
endfor;
endfor;
function titleReplace($s)
{
$tr = array('ş','Ş','ı','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç',' ','?','Y','y','?','?','.','/');
$eng = array('s','S','i','I','g','G','u','U','o','O','C','c','-','g','I','i','s','','');
$s = str_replace($tr,$eng,$s);
$s = strtolower($s);
$s = preg_replace('/&.+?;/', '', $s);
$s = preg_replace('/[^%a-z0-9 _-]/', '', $s);
$s = preg_replace('/\s+/', '-', $s);
$s = preg_replace('|-+|', '-', $s);
$s = trim($s, '-');
return $s;
}
?>Edit : Pardon , üst mesajıda en son ben yazmışım.Okumadan yazdım.