Skip to content

Instantly share code, notes, and snippets.

@jjjake
Last active December 10, 2015 20:18
Show Gist options
  • Select an option

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

Select an option

Save jjjake/4487494 to your computer and use it in GitHub Desktop.
Return a list of wcd items without ogg's, no older than two days (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;
}
$two_days_ago = date("Y-m-d", time() - 60 * 60 * 24 * 2);
$metamgr_url = "http://www.us.archive.org/metamgr.php?f=exportIDs&w_mediatype=audio&w_format=!*ogg*&w_collection=what_cd*&w_publicdate=%3E".$two_days_ago."&w_curatestate=!dark%20or%20null";
echo get_data($metamgr_url);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment