Esempio n. 1
0
 public static function ajax_get_memento()
 {
     if (isset($_REQUEST['url'], $_REQUEST['date'])) {
         header("Content-Type: application/json");
         header("Cache-Control: no-cache, must-revalidate");
         header("Pragma: no-cache");
         header("Expires: 0");
         $date = str_replace(" ", "+", $_REQUEST['date']);
         $memento_service = Amber::get_memento_service();
         $lookup_result = $memento_service->getMemento($_REQUEST['url'], $date);
         print json_encode($lookup_result, JSON_UNESCAPED_SLASHES);
         status_header(200);
     } else {
         status_header(400);
     }
     die;
 }