mirror of
https://github.com/Ahwxorg/Binternet.git
synced 2026-03-11 08:54:37 +00:00
added qwant for now, again with librex' code, since that works for now...
This commit is contained in:
parent
d55a062d4d
commit
4f320e60f7
3 changed files with 5 additions and 18 deletions
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
function get_image_results($query)
|
||||
{
|
||||
$url = "https://www.pinterest.com/search/pins/?q=$query";
|
||||
// $url = "https://www.pinterest.com/search/pins/?q=$query";
|
||||
$url = "https://lite.qwant.com/?q=$query&t=images";
|
||||
$response = request($url);
|
||||
$xpath = get_xpath($response);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ $requested_root_domain = get_root_domain($url);
|
|||
|
||||
$allowed_domains = array("pinterest.com", "i.pinimg.com", "pinimg.com");
|
||||
|
||||
if (in_array($requested_root_domain, $allowed_domains))
|
||||
{
|
||||
//if (in_array($requested_root_domain, $allowed_domains))
|
||||
//{
|
||||
$image = $url;
|
||||
$image_src = request($image);
|
||||
|
||||
header("Content-Type: image/jpeg");
|
||||
echo $image_src;
|
||||
}
|
||||
//}
|
||||
?>
|
||||
|
||||
|
|
|
|||
14
search.php
14
search.php
|
|
@ -4,21 +4,7 @@ require "engines/pinterest.php";
|
|||
|
||||
$query = $_GET['q'];
|
||||
|
||||
//$url = "https://pinterest.com/search/pins/?q=$q";
|
||||
//$pinterestPage = file_get_contents($url);
|
||||
|
||||
//$doc = new DOMDocument();
|
||||
//@$doc->loadHTML($html);
|
||||
|
||||
//$items = $doc->getElementsByTagName('img');
|
||||
|
||||
//foreach ($items as $item) {
|
||||
// echo "<img src='", $item, "'>";
|
||||
//}
|
||||
|
||||
$imgResults = get_image_results($query);
|
||||
print_image_results($imgResults);
|
||||
|
||||
// echo $pinterestPage;
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue