示例#1
0
    foreach ($dir as $file) {
        $file_path = $file->getPathname();
        if ($file->isFile() && '.' != substr($file->getFilename(), 0, 1)) {
            $files[$file->getMTime() . $file->getFilename()]['path'] = $file_path;
            $files[$file->getMTime() . $file->getFilename()]['name'] = $file->getFilename();
        }
    }
    krsort($files);
    return $files;
}
$max = 40;
foreach (getFilePaths($REPO) as $file) {
    $max--;
    if ($max > 0) {
        $mtime = filemtime($file['path']);
        if (time() - $mtime < 48 * 3600) {
            print $file['path'] . ":" . filemtime($file['path']) . "\n";
            $acc = str_replace('.tif', '', $file['name']);
            $res = $client->search('acc_num_PK:' . $acc);
            print_r($res);
            if (isset($res->items) && count($res->items)) {
                $url = 'https://daseupload.laits.utexas.edu' . $res->items[0]->links->media;
                //$bits = file_get_contents($file['path']);
                //$resp = DaseClient::post($url,$bits,$user,$pass,'image/tiff');
                //print_r($resp);
            } else {
                print "found no record in DASe\n";
            }
        }
    }
}
示例#2
0
<?php

include 'DaseClient.php';
$client = new DaseClient('keanepj');
$res = $client->search('hotel');
$app_root = $res->app_root;
$total = $res->total;
$html = "<html><head><title>DaseClient Sample</title></head><body>";
$html .= "<h1>DaseClient Sample</h1>";
$html .= "<h3>{$total} items found</h3>";
$html .= "<ul>";
foreach ($res->items as $item) {
    if (isset($item->metadata->keyword)) {
        $html .= '<li><img src="' . $app_root . '/' . $item->media->small . '">' . $item->metadata->keyword[0] . "</li>\n";
    }
}
$html .= "</ul>";
$html .= "</body></html>";
echo $html;
示例#3
0
<?php

include 'DaseClient.php';
$client = new DaseClient('keanepj', false);
$q = trim(strip_tags($_GET['q']));
$res = $client->search($q);
header('Content-type: application/json');
echo $res;
示例#4
0
<?php

//shows results in PHP and JSON
include 'DaseClient.php';
$client = new DaseClient('keanepj');
$res = $client->search('favorite');
$app_root = $res->app_root;
$total = $res->total;
print_r($res);
$client = new DaseClient('keanepj', false);
$res = $client->search('favorite');
print $res;
示例#5
0
$user = '******';
$pass = DaseClient::promptForPassword($user);
$filename = 'joshu_md2.csv';
$handle = fopen($filename, "r");
$meta = array();
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $filename = $data[0];
    $meta[$filename]['filename'] = $data[0];
    $meta[$filename]['grammar_tags'] = explode('|', $data[1]);
    $meta[$filename]['english_title'] = $data[2];
    $meta[$filename]['japanese_title'] = $data[3];
}
fclose($handle);
foreach ($meta as $filename => $m) {
    $title = $filename . '.mov';
    $res = $client->search('@title:' . $title);
    $url = $res->app_root . $res->items[0]->links->metadata;
    if ($url) {
        $pairs = array();
        foreach ($m as $k => $v) {
            if (is_array($v)) {
                $vset = array();
                foreach ($v as $str) {
                    $vset[] = '"' . $str . '"';
                }
                $pairs[] = '"' . $k . '":[' . join(',', $vset) . ']';
            } else {
                $pairs[] = "\"{$k}\":\"{$v}\"\n";
            }
        }
        $json = "{" . join(',', $pairs) . "}\n";
示例#6
0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>My Favorites</title>

		<link rel="stylesheet" type="text/css" href="www/css/style.css">
<script type="text/javascript" src="www/scripts/jquery.js"></script>
</head>

<?php 
include 'DaseClient.php';
$client = new DaseClient('keanepj');
$res = $client->search('keyword:favorite item_type:room');
$app_root = $res->app_root;
$total = $res->total;
?>

<body>

<h1>My Favorites (<?php 
echo $total;
?>
 items found)</h1>

<ul>

<?php 
foreach ($res->items as $item) {
    ?>