コード例 #1
0
<input type="submit" name="submit" id="submit" value="Submit" />
</form>

<?php 
include 'pubmedapi.php';
if (isset($_POST["submit"])) {
    $blogname = $_POST["blog"];
    $pmid = $_POST["pmid"];
    $pubimage = $_POST["image"];
    $extra = $_POST["extra"];
    $date = $_POST["date"];
    $tags = $_POST["tags"];
    //Process date
    $pubdate = gmdate('Y-m-d H:i:s', strtotime("+" . $date . " day")) . " GMT";
    //Perform PUBMED lookup
    $pma = new PubMedAPI();
    $pma_results = $pma->query_pmid($pmid);
    $title = $pma_results[0]["title"];
    $authors = implode(", ", $pma_results[0]["authors"]);
    $year = $pma_results[0]["year"];
    $journal = $pma_results[0]["journalabbrev"];
    $issue = $pma_results[0]["issue"];
    $vol = $pma_results[0]["volume"];
    // check for returned data or msg user to try again
    $publink = "http://www.ncbi.nlm.nih.gov/pubmed/{$pmid}";
    $pubcaption = "<p>{$title}<br /><a href=\"{$publink}\">{$authors} ({$year}) {$journal} {$issue}({$vol}).</a></p>{$extra}";
    // Start a session, load the library
    session_start();
    require_once 'tumblroauth.php';
    // Define the needed keys
    $consumer_key = "AvTd3aL9BsMwVqz0XTmUSy8QsZBrMwwXhDH0P9BgsNNKxzdx6U";
コード例 #2
0
<?php

include 'PubMedAPI.php';
$search_term = 'big data[TIAB]';
$pubMedAPI = new PubMedAPI();
$pubMedAPI->display_mode = false;
// $pubMedAPI->data_type = 'json';
$results = $pubMedAPI->search($search_term);
foreach ($results->articles as $r) {
    echo $r->abstract . '<br/><br/>';
}
コード例 #3
0
    {
        global $bad_utf8_chars;
        $bad_utf8_chars = array("", "­", "̷", "̸", "ᅟ", "ᅠ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "​", "‎", "‏", "‪", "‫", "‬", "‭", "‮", " ", " ", " ", "ㅤ", "", "ᅠ", "", "", "", "‍");
        function _remove_bad_characters($array)
        {
            global $bad_utf8_chars;
            return is_array($array) ? array_map('_remove_bad_characters', $array) : str_replace($bad_utf8_chars, '', $array);
        }
        $_GET = _remove_bad_characters($_GET);
        $_POST = _remove_bad_characters($_POST);
        $_COOKIE = _remove_bad_characters($_COOKIE);
        $_REQUEST = _remove_bad_characters($_REQUEST);
    }
    remove_bad_characters();
    include 'PubMedAPI.php';
    $PubMedAPI = new PubMedAPI();
    if (isset($_GET['page'])) {
        $PubMedAPI->retstart = $PubMedAPI->retmax * ((int) $_GET['page'] - 1) + 1;
    }
    $results = $PubMedAPI->query($term, false);
}
?>

<?php 
if (!empty($results)) {
    ?>
	<p>Search results for <strong><?php 
    echo urldecode($PubMedAPI->term);
    ?>
</strong> (<?php 
    echo $PubMedAPI->count;