logicfx Posted February 28, 2012 Share Posted February 28, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/257946-begginer-needing-help-with-scraping/ Share on other sites More sharing options...
blacknight Posted February 28, 2012 Share Posted February 28, 2012 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; } } Quote Link to comment https://forums.phpfreaks.com/topic/257946-begginer-needing-help-with-scraping/#findComment-1322138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.