Jump to content

image grab logs filling up with missing files


sitesadmin

Recommended Posts

Need some help please my logs are getting so full of missing files.For Myspace profiles. Sorry for the long message but im at my wits end with this.

 

//echo "buff--> = ".$buff."--------->";
preg_match("/<a type=\"text\/javascript\" id=\"ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage\" href=\"http:\/\/viewmorepics.myspace.com\/index\.cfm\?fuseaction=user\..*?friendID=$friend_id\">.*?<img border=\"0\" alt=\"\" src=\"(.*?)\" \/\><\/a\>/is",$buff,$match);

This works for regular profiles fine but music profiles it get leters above names and the missing file box.

 

 

for instance this profile 15959054 this is what it pulls

ica, sans-serif">
				Garage / Rap / R&B 








					<img src="http://a616.ac-images.myspacecdn.com/images01/107/m_28a90fcd08e1f464294865519229b47f.gif

 

Also this is one other profile 233184916 this is what it comes up with in sql

size="1" face="Arial, Helvetica, sans-serif">
				Hip Hop / Rap / R&B 








					<img src="http://a701.ac-images.myspacecdn.com/images01/98/m_73ba9fed7df12932c70d162cdb5d05c4.jpg

 

 

 

Below is the entire code.

<?php

class socket
{
function GetFromMyspace($friend_id)
{
	$full_file_path = MYSPACE_PROFILE_PATH.$friend_id;

	$handle = fopen($full_file_path,"r");
	if (!$handle)
	{
    		echo "<p>Unable to open remote file.\n";
    		$arr = 0;
	}
	else
	{
		$timeout = 300;
		//$old = ini_set('default_socket_timeout', $timeout);
		//	ini_set('default_socket_timeout', $old);
		//stream_set_timeout($handle, $timeout);
		//stream_set_blocking($handle, 0);
		//	set_time_limit(120);
		ini_set('max_execution_time','120');
		set_time_limit(120);
		ini_set('default_socket_timeout','120');
		while($contents = fread($handle,'1024'))
		{
			$buff .= $contents;
		}

		//echo "buff--> = ".$buff."--------->";
preg_match("/<a type=\"text\/javascript\" id=\"ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage\" href=\"http:\/\/viewmorepics.myspace.com\/index\.cfm\?fuseaction=user\..*?friendID=$friend_id\">.*?<img border=\"0\" alt=\"\" src=\"(.*?)\" \/\><\/a\>/is",$buff,$match);

		$string_ahref = $match[0];
		//echo "string = ".$string_ahref;


		$substr = substr($string_ahref,0,355);

		$trimed = strip_tags($substr,"<img>");
		$trimed = trim($trimed);
		//echo "strip".$trimed;
		$trimed = substr($trimed, 0 , -4);

		$len = strlen($trimed);
		//echo "length".$len."<br>";
		$image_name = substr($trimed,28,($len-25));
		//echo "<br><br>imname= '".$image_name."'<br>";

		preg_match("/<span class=\"nametext\".*>?<\/span>/is",$buff,$match_name);

		//echo "name= ".$match_name[0];

		if(empty($image_name))
		{
			$img_name = substr($match_name[0],100,600);
			$img  = strip_tags($img_name,"<img>");

			//echo "strip-->".$img."<--";
			$img = trim($img);


			$len = strlen($img);
			//echo "length".$len."<br>";

			$image_name = substr($img,10,($len-25));

			$image_name = trim($image_name);
			//echo "ooo".$img."000";
			//echo "Image = ->".$image_name."<--";
		}



		if(substr($image_name,0,10)=="<img src=\"")
		{
			$third_name = substr($image_name,10,strlen($image_name));
			//echo "third = ".$third_name;
			$image_name = $third_name;
		}

		//echo "<br><br>imname= '".$image_name."'<br>";
		$subname    = substr($match_name[0],0,200);
		$name       = strip_tags($subname,"<span>");
		$name = trim($name);

		$len_name   = strlen($name);
	//	echo $len_name;	
		$name_final = substr($name,23,($len_name-30));

		$arr = array("name"=>$name_final,"imagepath"=>$image_name);

		//exit();
	}
	fclose($handle);
	ini_restore('max_execution_time');
	ini_restore('default_socket_timeout');
	return $arr;

}
}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.