-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbulk_get_file.php
47 lines (31 loc) · 991 Bytes
/
bulk_get_file.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
//bulk_file_get.php
//By providing a CSV file with the URLS this will download all the required elements
include_once('config.php');
include_once('get_files.php');
echo "Running Bulk IA Scraper with file: ".$INSTALL_DIR.$BULK_CSV." ".$LE;
$blist = load_blacklist();
$bf = fopen($INSTALL_DIR.$BULK_CSV,"r");
while (!feof($bf)) {
$process = trim(fgets($bf));
if ($process == NULL || $process == "")
continue;
//if it has been downloaded jump to next item
if(check_if_dl($process)){
echo $process." ...already downloaded.".$LE;
continue;
}
if (!on_blacklist($process,$blist)) {
//Attempt and Check all it one
if (!download_data($process)) {
write_single_log($process,$INSTALL_DIR.$BAD_RSS_ITEMS);
echo $process. " ...error downloading, item logged.".$LE;
}
else {
write_single_log($process,$INSTALL_DIR.$GOOD_ITEMS);
echo $process. " ...done.".$LE;
}
}
}
echo "\n<br> Bulk Scrape Completed!";
?>