-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-apis.php
59 lines (46 loc) · 1.01 KB
/
test-apis.php
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
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require 'vendor/autoload.php';
require 'config.php';
require 'db.php';
require 'auth.php';
require 'functions.php';
?>
<pre>
<?php
if( ini_get('allow_url_fopen') ) {
print('allow_url_fopen is enabled. file_get_contents should work well');
} else {
print('allow_url_fopen is disabled. file_get_contents would not work');
}
print("<br><br>Local");
$res = searchLocal("".$_GET["q"]);
if (count($res)>0){
print_r($res);
}else{
print_r(error_get_last());
}
print("<br><br>Bibsonomy");
$res = searchBibsonomy("".$_GET["q"]);
if (count($res)>0){
print_r($res);
}else{
print_r(error_get_last());
}
print("<br><br>CrossRef");
$res = searchCrossRef("".$_GET["q"]);
if (count($res)>0){
print_r($res);
}else{
print_r(error_get_last());
}
print("<br><br>Arxiv");
$res = searchArXiv("".$_GET["q"]);
if (count($res)>0){
print_r($res);
}else{
print_r(error_get_last());
}
?>
</pre>