$link_cache['_threads'][$thread]['links'][] = $link; } if (!$link_cache[$link]['downloaded']) { $new_count++; dout("Sending link to download: " . $link); if (jdremote_download($link)) { $link_cache[$link]['downloaded'] = true; $link_cache[$link]['downloaded_time'] = time(); } else { $new_fail_count++; dout("... FAILED."); } } else { $skipped_count++; } } dout("Site crawl results: " . $new_count . " new links, of which " . $new_fail_count . " could not be sent to JD. " . $skipped_count . " links where skipped."); } if ($new_count + $new_fail_count + $skipped_count == 0) { dlog(dout("No threads or all threads failed.", true)); } else { dlog('New: ' . $new_count . ' Fail: ' . $new_fail_count . ' Skipped: ' . $skipped_count); } dout("Writing link cache..."); file_put_contents('data/cache', serialize($link_cache)); dout("Saving site data..."); datafile_write($sites); dout("Sending start to JD."); jdremote_start(); jdremote_close(); dout("FINISHED.");
<?php include_once "includes/config.inc"; include_once "includes/util.inc"; include_once "includes/jdremote.api.inc"; include_once "includes/sources.api.inc"; include_once "includes/datafile.api.inc"; $sites = datafile_read('data/sites'); $hosts = datafile_read('data/hosts'); datafile_write($sites); datafile_write($hosts);
<?php include_once "includes/config.inc"; include_once "includes/util.inc"; include_once "includes/jdremote.api.inc"; include_once "includes/sources.api.inc"; include_once "includes/datafile.api.inc"; include_once "includes/templates.api.inc"; include_once "includes/interface.api.inc"; global $SITES, $HOSTS, $LINK_CACHE; jdremote_init(); $SITES = datafile_read('data/sites'); $HOSTS = datafile_read('data/hosts'); if (is_readable('data/cache')) { $LINK_CACHE = unserialize(file_get_contents('data/cache')); } else { $LINK_CACHE = array(); } $CONFIG['verbose'] = false; interface_set_baseurl($_SERVER['PHP_SELF']); interface_set_default("overview"); interface_exec($_GET['page'], $_GET['action']); file_put_contents('data/cache', serialize($LINK_CACHE)); datafile_write($SITES); datafile_write($HOSTS);