Hola todos.
Es posible cambiar los links de las imágenes de Google ?. Lo que quiero es que el link apunte directamente al sitio y no a la biblioteca de Google.
Logré esto, tengo el link que necesito pero ahí estoy trancada
Código PHP:
$full='<a href="/imgres?imgurl=http://www.animalhealthfoundation.com/Images/beloved-horses.jpg&imgrefurl=http://www.animalhealthfoundation.com/about.html&h=600&w=800&sz=57&tbnid=ibidPAhcu4QJ::&tbnh=107&tbnw=143&prev=/images%3Fq%3Dhorses&hl=es&usg=__87z8GeCCkkG1C8l7DjD5Dv9M0LU=&sa=X&oi=image_result&resnum=1&ct=image&cd=1">
<img height="107" width="143" border="1" align="middle" title="http://www.animalhealthfoundation.com/about.html" alt="http://www.animalhealthfoundation.com/about.html" src="http://tbn0.google.com/images?q=tbn:ibidPAhcu4QJ::www.animalhealthfoundation.com/Images/beloved-horses.jpg"/>
</a>';
preg_match('/\/imgres([\w\W]*?)\>/',$full,$ftu);
for ($az=0; $az< count($ftu[0]); $az++) {
$deko=$ftu[$az];
preg_match('/imgrefurl([\w\W]*?)h=/',$deko,$ftt2);
for ($r=0; $r< count($ftt2[0]); $r++) {
print_r($ftt2);
$d22=$ftt2[$r];
echo $d22;
$d22=str_replace("imgrefurl=", "", $d22);
$d22=str_replace("h=", "", $d22);
$d23=preg_replace('|<\/*a.*?>|si', "<a>".$d22."</a>", $full);
echo $d23;
}
}
Aquí guardo en una variable lo que viene de Google para que puedan ver el código que uso. Sé que ahí estoy eliminando los links que no es lo que necesito.
Alguien sabe cómo puedo hacer ?