Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. @hubgit hubgit revised this gist Feb 20, 2012. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions elsevier-open-miner-service.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    <?php

    $params = array(
    'client' => 'lipids',
    'app' => 'lipids',
    'client' => 'lipids', // or 'locus', for Arabidopis
    'app' => 'lipids', // or 'locus', for Arabidopis
    'mimetype' => 'text/html',
    'contents' => file_get_contents('article.html'),// read the article HTML from a separate file
    );
    @@ -18,4 +18,4 @@
    ));

    $response = curl_exec($curl);
    print_r($response);
    print_r($response);
  2. @hubgit hubgit created this gist Feb 20, 2012.
    21 changes: 21 additions & 0 deletions elsevier-open-miner-service.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <?php

    $params = array(
    'client' => 'lipids',
    'app' => 'lipids',
    'mimetype' => 'text/html',
    'contents' => file_get_contents('article.html'),// read the article HTML from a separate file
    );

    $curl = curl_init('http://tryit.elsevier.com/oms/OpenMinerService');

    curl_setopt_array($curl, array(
    //CURLOPT_VERBOSE => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query($params),
    CURLOPT_USERPWD => 'OMS:Op3nM1n3rS3rv1c3',
    ));

    $response = curl_exec($curl);
    print_r($response);