Skip to content

Instantly share code, notes, and snippets.

@jjjake
Created January 8, 2013 20:11
Show Gist options
  • Select an option

  • Save jjjake/4487492 to your computer and use it in GitHub Desktop.

Select an option

Save jjjake/4487492 to your computer and use it in GitHub Desktop.
Return a list of AIT items without CDXs, older than one week (for handoff to auto_submit.php perpetual loop).
<?
function get_data($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$last_week = date("Ymd", time() - 60 * 60 * 24 * 7);
$metamgr_url = "http://www.us.archive.org/metamgr.php?f=exportIDs&w_identifier=archiveit*&w_mediatype=web&w_format=!*cdx*&w_collection=archiveit*&w_scandate=%3C".$last_week;
echo get_data($metamgr_url);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment