Jump to content

Begginer needing help with scraping


logicfx

Recommended Posts

Hello,

I have checked out many of the scripts and tried implementing them to help me scrape 1 single image from a url. Example www.123.com/333.png

 

Getting a script to scrape that image isnt the problem. Im not sure on how to implement the simple curl to save the image every 30mins and name it in successive order so it appears as , 1.jpg, 2.jpg, 3.jpg

 

I am working with a debian 6 server and php would be the easiest way to do this that i can work with. I have searched the web endlessly and still cant produce such thing.

Any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/257946-begginer-needing-help-with-scraping/
Share on other sites

this is a simple fuction that will save the image to your server

function save_image($inPath,$outPath)
{
//Download images from remote server
$in=    fopen($inPath, "rb");
$out=   fopen($outPath, "wb");
while ($chunk = fread($in,8192))
{
	fwrite($out, $chunk, 8192);
}
fclose($in);
fclose($out);
if (file_exists($outPath))
{
	return true;
}
else
{
	return false;
}
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.