rozbif Posted May 29, 2011 Share Posted May 29, 2011 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; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/237770-php-modul-problem-please-help-images-module-for-meta-search-engine/ Share on other sites More sharing options...
mikesta707 Posted May 29, 2011 Share Posted May 29, 2011 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) Quote Link to comment https://forums.phpfreaks.com/topic/237770-php-modul-problem-please-help-images-module-for-meta-search-engine/#findComment-1221855 Share on other sites More sharing options...
rozbif Posted May 29, 2011 Author Share Posted May 29, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/237770-php-modul-problem-please-help-images-module-for-meta-search-engine/#findComment-1221859 Share on other sites More sharing options...
rozbif Posted May 29, 2011 Author Share Posted May 29, 2011 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 .... Quote Link to comment https://forums.phpfreaks.com/topic/237770-php-modul-problem-please-help-images-module-for-meta-search-engine/#findComment-1221866 Share on other sites More sharing options...
rozbif Posted May 29, 2011 Author Share Posted May 29, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/237770-php-modul-problem-please-help-images-module-for-meta-search-engine/#findComment-1221886 Share on other sites More sharing options...
rozbif Posted May 29, 2011 Author Share Posted May 29, 2011 If somebody wants to help, i can even send full PHP code of meta search engine just mail me to googleov@googleov.com Quote Link to comment https://forums.phpfreaks.com/topic/237770-php-modul-problem-please-help-images-module-for-meta-search-engine/#findComment-1221894 Share on other sites More sharing options...
rozbif Posted May 29, 2011 Author Share Posted May 29, 2011 Please any help is welcome Quote Link to comment https://forums.phpfreaks.com/topic/237770-php-modul-problem-please-help-images-module-for-meta-search-engine/#findComment-1222052 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.