Jump to content

PHP modul problem, please help (images module for meta search engine)


rozbif

Recommended Posts

I have problem with PHP module for meta search engine, this module takes image results from google and sends it to meta search engine as a result. But it is not working, there is a problem in PHP code witch i have no idea how to find and fix.

<?php


class image_google {

    function image_google() {
        $this->profile = array(
            'site_name' => 'Google',
            'site_url' => 'http://www.google.com',
            'request_url' => 'http://www.google.com/search?q=$e_qry_str&site=images&tab=wi&start='.(20*($_REQUEST['d']-1)),
        );
    }

    function parse_results(&$output) {
        #echo $output;  # debug
        $results = array();
        if(preg_match_all('{imgurl=(.*?)&imgrefurl=(.*?)&}is',html_compress(remove_code($output)),$matches,PREG_SET_ORDER)) {
            $last_match = '';
            foreach($matches as $r) {
                $result = array(
                    'real_url' => html_decode($r[2]),
                                                 'follow_url' => html_decode($r[1]),
                    'image_url' => html_decode($r[1]),
                    'title' => html_decode($r[1]),
                    'description' => html_decode($r[1]),
                );
                array_push($results,$result);
                $last_match = &$r[0];
            }
            if($last_match) {
                $offset = strpos($output,$last_match)+strlen($last_match);
                $output = substr($output,$offset);
            }
        }
        #var_export($results); # debug
        return $results;
    }

}

?>

How exactly is it "not working". Not working can mean 1 of many many things, and without more information, its hard to pinpoint a problem. Is there an error? Is nothing happening? is something happening but not what you expect?

 

Basically, we need to know what is happening, what you want to happen, and any other information (like if there is an error or something)

This happens http://googleov.com/search?qry_str=images&category=images

when somebody trays to do an image search

but if i add this code    if(preg_match_all('{imgurl=(.*?)&imgrefurl=(.* ?)&}is'      it shows 2 images and a lot of links below them

 

This happens http://googleov.com/search?qry_str=images&category=images

when somebody trays to do an image search

but if i add this code    if(preg_match_all('{imgurl=(.*?)&imgrefurl=(.* ?)&}is'      it shows 2 images and a lot of links below them

But it needs to show 20 images per page, without all of those huge links. only 20 images and title ....

Basically this image search needs to work just like videos search

 

Images search:

http://googleov.com/search?qry_str=images&category=images&submit=Search

 

And videos search (image search needs to look the same )

http://googleov.com/search?qry_str=images&category=videos&submit=Search

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.