Visually Impaired-Search Engine
Search Engine for the Visually Impaired

'; if ($_GET[q]) { $q = rawurlencode($_GET[q]); $page = $_GET[page]; if (! $page) { $page = 1; } if ($gonews) { $bar = "http://search.yahooapis.com/NewsSearchService/V1/newsSearch?results=10&start=$page&appid=bassfishing&query=$q&format=html&adult_ok=1®ion=us"; $bar = file_get_contents($bar); $p = xml_parser_create(); xml_parse_into_struct($p, $bar, $values, $tags); xml_parser_free($p); $data = XMLToArray($values); $totalfound = $values[0][attributes][TOTALRESULTSAVAILABLE]; $x = $values[0][attributes][FIRSTRESULTPOSITION]; $x++; $results = $data[RESULTSET][RESULT]; $x = 0; if(is_array($results)) { while (list($k,$v)=each($results)) { # array_print($v); $date = strftime("%b %d, %Y %I:%M %p",$v[PUBLISHDATE]); $source = $v[NEWSSOURCE]; $summary = $v[SUMMARY]; $title = $v[TITLE]; $news .= "u NEWS: $title
$source
($date)
$summary


This divider separates results

"; } } } ############################################ if ($goweb) { $bar = "http://search.yahooapis.com/WebSearchService/V1/webSearch?results=10&start=$page&appid=bassfishing&query=$q®ion=us&format=html"; $bar = file_get_contents($bar); $p = xml_parser_create(); xml_parse_into_struct($p, $bar, $values, $tags); xml_parser_free($p); $data = XMLToArray($values); $totalfound = ($totalfound + $values[0][attributes][TOTALRESULTSAVAILABLE]); $x = $values[0][attributes][FIRSTRESULTPOSITION]; $x++; $results = $data[RESULTSET][RESULT]; $x = 0; if(is_array($results)) { while (list($k,$v)=each($results)) { $summary = $v[SUMMARY]; $title = $v[TITLE]; $web .= "u $title
spacer
$summary
spacer
" . sprintf("%.30s", $v[URL]) . "...

 l  OPEN RESULT in a NEW WINDOW
 l  TEXT ONLY VERSION of this WEB PAGE
 l  Is this SITE in the GOOGLE ACCESSIBLE INDEX
 l  SIMILAR PAGES to this RESULT from GOOGLE


This divider separates results
"; } } } ############################################ if ($goimages) { $bar = "http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=bassfishing&query=$q&results=20"; $bar = file_get_contents($bar); $p = xml_parser_create(); xml_parse_into_struct($p, $bar, $values, $tags); xml_parser_free($p); $data = XMLToArray($values); $totalfound = ($totalfound + $values[0][attributes][TOTALRESULTSAVAILABLE]); $x = $values[0][attributes][FIRSTRESULTPOSITION]; $x++; $results = $data[RESULTSET][RESULT]; $x = 0; if(is_array($results)) { while (list($k,$v)=each($results)) { $alt = $v[SUMMARY]; $title = $v[TITLE]; $target = $v[URL]; unset($img); if(is_array($v[THUMBNAIL])) { while (list($a,$b)=each($v[THUMBNAIL])) { $img = $b[URL]; $hei = $b[HEIGHT]; $wid = $b[WIDTH]; } } if ($img) { $images .= "\"$title:

"; } } } } ############################################ } if ($totalfound) { $pages = round($totalfound / 10); if ($totalfound == 1) { print "1 result found: "; } else { print number_format($totalfound) . " Results Found for:  $_GET[q] "; } if ($pages > 20) { $pages = 20; } while ($y < $pages) { $y++; $chunk .= ""; if ($y == $page) { $chunk .= "$yspacer "; } else { $chunk .= "$y   "; } $chunk .= " "; } print "
"; if ($images) { $table_headers[1] = "Top 20 Images"; $table_stats[1] = " valign=\"top\" width=\"136\" align=\"center\" BGCOLOR=\"#000000\" "; $table_body[1][1] = "$images"; } if ($web) { $table_headers[2] = "Web Results"; $table_stats[2] = " valign=\"top\" width=\"65%\"BGCOLOR=\"#252525\" "; $table_body[1][2] = "$web"; } if ($news) { $table_headers[3] = "News"; $table_stats[3] = " valign=\"top\" width=\"35%\" BGCOLOR=\"#252525\" "; $table_body[1][3] = "$news"; } print "

Access Keys: (Alt+t Enter) Top of Page   (Alt+n Enter) 1st News Article   (Alt+b TAB) Text Box   (Alt+r TAB) Results Pages

"; print Content_Table($table_headers, $table_body, $table_stats); print "   VI-SE Web Results Only        Results for ($_GET[q]) from Google Accessible Search

PAGE:   $chunk

Access Key Links: (Alt+t Enter) Top of Page   (Alt+n Enter) First News Article   (Alt+b TAB) Go to Text Box

"; } print "


Magnify:

Why use VI-SE.com:
Uses APHont font Large Text W3C Color Contrast Large Text Boxes
Magnify Option Web & News Results Links to Text Only No Ads
Yahoo Results Fast Results Few Graphics Access Keys
All Rights Reserved 2007 VI-SE.com    Results courtesy of YaHoo.com

Download APHont    RoboBraille    Screen Magnifiers    Google Accessible Search

This site is built with Web Accessibility In Mind!  color compliant banner
"; function Content_Table($table_headers, $table_body, $table_stats='') { $site_bgcolor = "F0F0F0"; $site_fgcolor = "FFFFFF"; if (is_array($table_body)) { $table_content = "
"; if (is_array($table_headers)) { $table_content .= "\n\n"; reset($table_headers); while (list ($key, $val) = each ($table_headers)) { $table_content .= "\n"; } $table_content .= "\n\n"; } if (is_array($table_body)) { reset($table_body); while (list ($key, $val) = each ($table_body)) { $table_content .= "\n"; reset($table_body[$key]); while (list ($foo, $bar) = each ($table_body[$key])) { $table_content .= " \n"; } $table_content .= "\n\n"; } } $table_content .= "
$val
$bar
\n"; } return ($table_content); } function XMLToArray($xml) { // From php.net $_tmp=''; foreach ($xml as $xml_elem) { $x_tag=$xml_elem['tag']; $x_level=$xml_elem['level']; $x_type=$xml_elem['type']; if ($x_level!=1 && $x_type == 'close') { if (isset($multi_key[$x_tag][$x_level])) { $multi_key[$x_tag][$x_level]=1; } else { $multi_key[$x_tag][$x_level]=0; } } if ($x_level!=1 && $x_type == 'complete') { if ($_tmp==$x_tag) { $multi_key[$x_tag][$x_level]=1; } $_tmp=$x_tag; } } foreach ($xml as $xml_elem) { $x_tag=$xml_elem['tag']; $x_level=$xml_elem['level']; $x_type=$xml_elem['type']; if ($x_type == 'open') { $level[$x_level] = $x_tag; } $start_level = 1; $php_stmt = '$xml_array'; if ($x_type=='close' && $x_level!=1) { $multi_key[$x_tag][$x_level]++; } while($start_level < $x_level) { $php_stmt .= '[$level['.$start_level.']]'; if (isset($multi_key[$level[$start_level]][$start_level]) && $multi_key[$level[$start_level]][$start_level]) { $php_stmt .= '['.($multi_key[$level[$start_level]][$start_level]-1).']'; } $start_level++; } $add=''; if (isset($multi_key[$x_tag][$x_level]) && $multi_key[$x_tag][$x_level] && ($x_type=='open' || $x_type=='complete')) { if (!isset($multi_key2[$x_tag][$x_level])) $multi_key2[$x_tag][$x_level]=0; else $multi_key2[$x_tag][$x_level]++; $add='['.$multi_key2[$x_tag][$x_level].']'; } if (isset($xml_elem['value']) && trim($xml_elem['value'])!='' && !array_key_exists('attributes',$xml_elem)) { if ($x_type == 'open') $php_stmt_main=$php_stmt.'[$x_type]'.$add.'[\'content\'] = $xml_elem[\'value\'];'; else $php_stmt_main=$php_stmt.'[$x_tag]'.$add.' = $xml_elem[\'value\'];'; eval($php_stmt_main); } if (array_key_exists('attributes',$xml_elem)) { if (isset($xml_elem['value'])) { $php_stmt_main=$php_stmt.'[$x_tag]'.$add.'[\'content\'] = $xml_elem[\'value\'];'; eval($php_stmt_main); } foreach ($xml_elem['attributes'] as $key=>$value) { $php_stmt_att=$php_stmt.'[$x_tag]'.$add.'[$key] = $value;'; eval($php_stmt_att); } } } return $xml_array; } // END XMLtoArray function ls_ledger() { static $calls = 0; static $color1 = "#efefef"; static $color2 = "#FFFFFF"; $calls++; if (($calls % 2) == 0) { return($color1); } else { return($color2); } } function array_print($array) { print "

Array:

"; print_r($array); print "

"; } ?>