Created
September 25, 2010 14:43
-
-
Save badsyntax/596898 to your computer and use it in GitHub Desktop.
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 | |
$files = array(); | |
if ($handle = opendir('.')) { | |
while (false !== ($file = readdir($handle))) { | |
if ($file[0] !== '.') { | |
$files[] = $file; | |
} | |
} | |
} | |
echo 'Getting file list..'; | |
$html = file_get_contents('http://archive.dubstep.fm/'); | |
preg_match_all('/(ARCHIVE_.*?\.mp3)/', $html, $matches); | |
echo "\n"; | |
foreach(array_unique($matches[0]) as $file){ | |
if (!in_array(urldecode($file), $files)) { | |
echo $file . "..."; | |
`wget http://archive.dubstep.fm/$file`; | |
} | |
} | |
?> |
Author
badsyntax
commented
Sep 25, 2010
- A small scraper script that downloads all the tracks listed on http://archive.dubstep.fm
- The script will not download tracks that have already been downloaded.
- Uses wget
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment