Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/peviitor-ro/api
Browse files Browse the repository at this point in the history
  • Loading branch information
sebiboga committed Oct 31, 2021
2 parents 21b7758 + c84cf5a commit b86ec4d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions v0/random/index.php
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;



?>

0 comments on commit b86ec4d

Please sign in to comment.