-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from peviitor-ro/live
copied random in v0 also
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
header("Access-Control-Allow-Origin: *"); | ||
|
||
|
||
/** | ||
* @OA\Get( | ||
* path="/v1/random/", tags={"search engine"}, | ||
* @OA\Response(response="200", description="Success") | ||
* ) | ||
*/ | ||
|
||
function get_server(){ | ||
//get the IP of the server | ||
//we need a config file to know where is the SOLR | ||
require('../../_config/index.php'); | ||
return $server; | ||
} | ||
|
||
|
||
$server = get_server(); | ||
|
||
$max=790; | ||
$start = rand(0,$max); | ||
$qs = 'q=*%3A*&rows=1&start='.$start.'&omitHeader=true'; | ||
|
||
$url = $server.'shaqodoon/select?'.$qs; | ||
|
||
|
||
$json = file_get_contents($url); | ||
echo $json; | ||
|
||
|
||
|
||
?> |