mirror of
https://github.com/Ahwxorg/Binternet.git
synced 2026-03-11 08:54:37 +00:00
remove old search page
This commit is contained in:
parent
7453d7a40a
commit
f1c22c370c
1 changed files with 0 additions and 53 deletions
|
|
@ -1,53 +0,0 @@
|
|||
<?php require "misc/header.php"; ?>
|
||||
<title>
|
||||
<?php
|
||||
$query = htmlspecialchars(trim($_REQUEST["q"]));
|
||||
echo $query;
|
||||
?> - Pinternet</title>
|
||||
</head>
|
||||
<body>
|
||||
<form class="searchContainer" method="get" autocomplete="off">
|
||||
<h1><a class="no-decoration" href="./"><span>P</span>inter<span>n</span>et</a></h1>
|
||||
<input type="text" name="q"
|
||||
<?php
|
||||
$query_encoded = urlencode($query);
|
||||
|
||||
if (1 > strlen($query) || strlen($query) > 64)
|
||||
{
|
||||
header("Location: ./");
|
||||
die();
|
||||
}
|
||||
|
||||
echo "value=\"$query\"";
|
||||
?>
|
||||
<br>
|
||||
<hr>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
$base = "https://pinterest.com/resource/BaseSearchResource/get/?data=%7B%22options%22%3A%7B%22query%22%3A%22{}%22%7D%7D";
|
||||
|
||||
$search = function($query) use($base)
|
||||
{
|
||||
$url = str_replace("{}", str_replace(" ", "%20", $query), $base);
|
||||
$json = file_get_contents($url);
|
||||
$data = json_decode($json);
|
||||
$images = array();
|
||||
foreach ($data->{"resource_response"}->{"data"}->{"results"} as $result)
|
||||
{
|
||||
$image = $result->{"images"}->{"orig"};
|
||||
$url = $image->{"url"};
|
||||
array_push($images, $url);
|
||||
}
|
||||
return $images;
|
||||
};
|
||||
|
||||
$images = $search($_REQUEST["q"]);
|
||||
echo json_encode($images);
|
||||
|
||||
foreach ($img as $imgs) {
|
||||
echo "<img src=",$img,">";
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in a new issue