Skip to content

Instantly share code, notes, and snippets.

@badsyntax
Created September 25, 2010 14:43
Show Gist options
  • Save badsyntax/596898 to your computer and use it in GitHub Desktop.
Save badsyntax/596898 to your computer and use it in GitHub Desktop.
<?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`;
}
}
?>
@badsyntax
Copy link
Author

  • 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