-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestScopus.php
More file actions
46 lines (36 loc) · 1.34 KB
/
testScopus.php
File metadata and controls
46 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
// trying to get http://kitchingroup.cheme.cmu.edu/blog/2015/04/03/Getting-data-from-the-Scopus-API/ working
$apiKeySB = "9cd2551192dde4abb70750d6bc89547e";
$scopusUrl = 'http://api.elsevier.com/content/author?author_id=19638592200&view=metrics';
// $command = escapeshellcmd('/home/sbr/www/test.py');
$command = "python";
$output = shell_exec("$command");
// exec("ls", $output);
print_r($output);
//$opts = array(
// 'http'=>array(
// 'method'=>"GET",
// 'header'=>"Accept: application/json\r\n" .
// "X-ELS-APIKey: ".$apiKeySB."\r\n"
// )
//);
//$body = "";
//$headers = "POST $scopusUrl 1.1\r\n";
// $headers .= "Content-type: application/x-www-form-urlencoded\r\n";
// $headers .= "Content-Type: application/json\r\n";
// $headers .= "Accept: application/json\r\n";
// $headers .= "X-ELS-APIKey: ".$apiKeySB."\r\n";
// if (!empty($body)) {
// $headers .= "Content-length: " . strlen($body) . "\r\n";
// }
// $headers .= "\r\n";
// $body = $query;
// if ($fp = fsockopen($scopusUrl, 80, $errno, $errstr, 180)) {
// fwrite($fp, $headers . $body, strlen($headers . $body));
// fclose();
// }
//$context = stream_context_create($opts);
// file_get_contents($scopusUrl, false, $context);
echo("==========");
// print_r($response);
?>