Hello XanthisHP,
My i've changed the part to get the results line from Yahoo. Look the script:
Code:
# 0.SETTING THE MAIN REMOTE ENGINE PARAMETERS
$site_name = 'Yahoo'; # name of the remote site - this name will appear
# on the result's output page
$host = "ink.yahoo.com"; # remote host address
$port = 80; # default web server port is 80
$method = 'GET'; # POST or GET http method we use
$remote_path = "/bin/query"; # relative web path to the remote script/page
# 3.PREPARING THE VARIABLES THAT WE HAVE TO PASS
# Variable/value pairs that we will pass to the remote search script.
# Look at the URL of the search result page if 'GET' method to see what are the pairs.
# If method is 'POST' open the search page source and look at the form description.
%variables = (
'p', '$query',
'hc', '11',
'hs', '500'
);
# Some of the search engines like HotBot require a special order of the pairs.
# The list below is the order in which we send the variables. If it does not
# matter make the list empty.
@order_of_variables = ('p','hc','hs');
# 5.PARSING THE DOWNLOADED PAGE
# Now we will look through the source trying to extract the search results.
$results = ''; # here we will strore all search results in database format -
# string with | signs as delimiter of the values
$n = 0; # number of results extracted successfully
# This is parsing TYPE1. - delimiters are numbers in order
foreach $i (1..9) {
$j = $i +1;
%result = (); # here we will store all components of a search result
$result_string = ""; # all components of a search result in database format
$result{'link'} = $link; # link to the downloaded page
# Now we try to extract the current search result's body from the source
if($page =~ m{<b>$i\. </b>(.+)<b>$j\. </b>}is){
$body = $1; # body is extracted
# print "search result's body - extracted\n"; # uncomment to debug
# try parsing the search result's body to get the components
if ($body =~ m{^<a href=\"(.+)\"><b>(.*)</b></a>(.+)--}is){
# print "search result's components - parsed\n"; # uncomment to debug
$n ++; # counting the found entries
$result{'URL'} = $1; # site's URL
$result{'title'} = $2; # site's title
$result{'description'} = $3; # site's description
$result{'rate'} = $i; # how do we rate this result
# removing all html tags from the site's description
$result{'description'} = &rm_tags($result{'description'});
# make the components in database formated string
$result_string = &ArrStr(\%result,\@result_structure);
# print "extracted data: $i $result_string\n"; # uncomment to debug
$results .= "$result_string\n"; # collect here the results
# as a miltiline string
};
};
};
help-me to finish this..
About your submit.cgi, you use LWP in this script??
------------------
[]'s
Lucas Saud - #34750464