mirror of
https://github.com/Ahwxorg/librey/
synced 2024-12-06 19:16:48 +01:00
added "my ip", "my user agent" special queries, settings set via parameters now persist, changed "type" to "t" for consistency
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
|
||||
if (!isset($_REQUEST["q"]))
|
||||
{
|
||||
echo "<p>Example API request: <a href=\"./api.php?q=gentoo&p=2&type=0\">./api.php?q=gentoo&p=2&type=0</a></p>
|
||||
echo "<p>Example API request: <a href=\"./api.php?q=gentoo&p=2&t=0\">./api.php?q=gentoo&p=2&t=0</a></p>
|
||||
<br/>
|
||||
<p>\"q\" is the keyword</p>
|
||||
<p>\"p\" is the result page (the first page is 0)</p>
|
||||
<p>\"type\" is the search type (0=text, 1=image, 2=video, 3=torrent)</p>
|
||||
<p>\"t\" is the search type (0=text, 1=image, 2=video, 3=torrent)</p>
|
||||
<br/>
|
||||
<p>The results are going to be in JSON format.</p>
|
||||
<p>The API supports both POST and GET requests.</p>";
|
||||
@@ -19,7 +19,7 @@
|
||||
$query = $_REQUEST["q"];
|
||||
$query_encoded = urlencode($query);
|
||||
$page = isset($_REQUEST["p"]) ? (int) $_REQUEST["p"] : 0;
|
||||
$type = isset($_REQUEST["type"]) ? (int) $_REQUEST["type"] : 0;
|
||||
$type = isset($_REQUEST["t"]) ? (int) $_REQUEST["t"] : 0;
|
||||
|
||||
$results = array();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user