Esempio n. 1
0
    /* Set your content font stack here: */
    font-family: Arial, Helvetica, sans-serif;
}
  </style>
</head>

<body>
<div id="container" class="pure-g">
<div class="pure-u-1-1 l-box">
<div><a class="pure-button" href="/">HOME</a></div>
<?php 
require_once 'key.php';
require_once 'nprbrowser.class.inc';
require_once 'krumo/class.krumo.php';
if (!empty($_GET['id'])) {
    $call = new NPRCall($creds[$server]['host'], $creds[$server]['key']);
    $options = array('id' => $_GET['id']);
    $call->pull($options);
    $story = $call->results[0];
    $title = htmlspecialchars($story->title->{'$text'}, ENT_QUOTES, 'UTF-8');
    print "<h2>{$title}</h2>";
    print "<h3>ID: {$story->id}</h3>";
    /*if ($doc->hasEnclosure()) {
        if ($doc->profile == 'image') {
          print "<a href=\"{$doc->getHREF()}\"><image width=\"300\" src=\"{$doc->getHREF()}\"></a>";
        }
        else if ($doc->profile == 'audio') {
          print "<audio controls src=\"{$doc->getHREF()}\"></audio>";
        }
        else {
          print "<{$doc->profile} src=\"{$doc->getHREF()}\"></{$doc->profile}>";
Esempio n. 2
0
    <input name="text" type="text" placeholder="Seach text" value="" class="pure-u-23-24">
    </div>
    
    <div class="pure-u-1 pure-u-md-1-3">
    <input name="id" type="text" placeholder="Enter an NPR ID" value="" class="pure-u-23-24 ">
    </div>
    
    </div>
    </fieldset>

    <input class="button-primary" type="submit" value="GO" />
</form>
</div>
</div>
<?php 
$call = new NPRCall($creds[$server]['host'], $creds[$server]['key'], FALSE);
$call->pull($options);
print "<div class='row'>" . krumo($call->query) . "</div>";
?>
<div class="pure-u-1-1 1-box">
<table class="pure-table"><thead><tr><th>TITLE</th><th>ID</th><!--<th>VIEW</th><th>EDIT</th><th>DELETE</th>--><th>PUBLISHED</th></tr></thead><tbody>
<?php 
if (!empty($call->results)) {
    foreach ($call->results as $story) {
        $date = $story->pubDate->{'$text'};
        print "<tr><td><a href='view.php?server={$server}&id={$story->id}'>{$story->title->{'$text'}}</a></td><td>{$story->id}</td>";
        print "<td>{$date}</td>";
        print "</tr>";
    }
} else {
    print "<tr><td colspan='4'>Sorry, no results for this query.</td></tr>";