Created
December 27, 2011 14:17
-
-
Save mihneawalker/1523780 to your computer and use it in GitHub Desktop.
downloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fsource = fopen('lista.txt','r'); | |
while (!feof($fsource)) { | |
$fline = fgetcsv($fsource,1000,','); | |
$remotePath = $fline[0]; | |
$localfname = ucwords($fline[1]); | |
$localfname = preg_replace("/[^a-zA-Z0-9s]/","",$localfname); | |
$xtn = pathinfo($remotePath, PATHINFO_EXTENSION); | |
$localfname ='pics/' . $localfname . '.'.$xtn; | |
//var_dump($localfname); | |
$dl = fopen($localfname,'w'); | |
/* | |
$ch = curl_init($remotePath); | |
curl_setopt($ch,CURLOPT_FILE,$dl); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
fclose($dl); | |
fclose($fsource); | |
*/ | |
//exec("wget -O $localfname $remotePath"); | |
} | |
?> | |
http://25.media.tumblr.com/tumblr_lwkmwccIht1qza249o1_400.jpg,We take off. | |
http://26.media.tumblr.com/tumblr_lwkbmkQAcN1qza249o1_400.jpg,We like this ad. | |
http://25.media.tumblr.com/tumblr_lwkbf6lNC41qza249o1_400.jpg,We are ready to leave. | |
http://30.media.tumblr.com/tumblr_lwjsuyqmAz1qza249o1_400.gif,We are speechless. | |
http://30.media.tumblr.com/tumblr_lwilk5Hzac1qza249o1_400.png,We are all over. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment