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
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;
}
}

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.