Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

%searchengines=( "MSN","http://sear

Status
Not open for further replies.

sulfericacid

Programmer
Aug 15, 2001
244
0
0
US
%searchengines=( "MSN"," "Lycos"," "Altavista"," "Google"," "AOL"," "IWON"," "WISENUT"," #"HotBot"," );


#This library contains a list of function that parse out
#The number of links to a home page.
#Each function parses out a different string
%commonurls=("AOL"," "CNET"," "FREEPERL"," "USARMY"," "NAPSTER"," "EBAY"," "CNN"," "HOMEWORKHELP"," "HIGHSCHOOLCLUB"," "GAMES"," );


#the following string represent the criteria needed to parse through
#the HTML page to find link popularity
%hitstring=( "MSN","of about",
"Lycos","articles were found",
"Altavista","We found \\d+ result",
&quot;HotBot&quot;,&quot;WEB\&nbsp;RESULTS\&nbsp;</SPAN> \&nbsp;\\d+\&nbsp;Matches&quot;,
&quot;Google&quot;,&quot;Results \<b\>1\<\/b\> - \<b\>\\d+\<\/b\> of about \<b\>\\d+&quot;,
&quot;AOL&quot;,&quot;\\(1 - \\d+ of \\d+&quot;,
&quot;IWON&quot;,&quot;var IWtotalresults = \\d+&quot;,
&quot;WISENUT&quot;,&quot;\<B\>Results\<\/B\> : \\d+&quot;,
);

%startindexstring=(&quot;MSN&quot;,&quot;of about&quot;,
&quot;Lycos&quot;,&quot;\<b\>&quot;,
&quot;Altavista&quot;,&quot;We found&quot;,
&quot;HotBot&quot;,&quot;WEB\&nbsp;RESULTS\&nbsp;</SPAN> \&nbsp;\\d+\&nbsp;Matches&quot;,
&quot;Google&quot;,&quot;of about \<b\>&quot;,
&quot;AOL&quot;,&quot; of &quot;,
&quot;IWON&quot;,&quot;=&quot;,
&quot;WISENUT&quot;,&quot;\<B\>Results\<\/B\> :&quot;,
);


%endindexstring=(
&quot;MSN&quot;,&quot;containing&quot;,
&quot;Lycos&quot;,&quot;\<\/b\>&quot;,
&quot;Altavista&quot;,&quot;results:&quot;,
&quot;HotBot&quot;,&quot;Matches&quot;,
&quot;Google&quot;,&quot;\<\/b\>. Search&quot;,
&quot;AOL&quot;,&quot;\)&quot;,
&quot;IWON&quot;,&quot;;&quot;,
&quot;WISENUT&quot;,&quot;document&quot;,
);

#this contains the number of characters in the string before
#the number of hits can be dissected
%offsetstr=(
&quot;MSN&quot;,&quot;8&quot;,
&quot;Lycos&quot;,&quot;3&quot;,
&quot;Altavista&quot;,&quot;9&quot;,
&quot;HotBot&quot;,&quot;35&quot;,
&quot;Google&quot;,&quot;12&quot;,
&quot;AOL&quot;,&quot;4&quot;,
&quot;IWON&quot;,&quot;1&quot;,
&quot;WISENUT&quot;,&quot;17&quot;,



*** I was wondering if anyone could tell me what this last segment of codes is doing, the %iffsetstr=( . What do these numbers actually mean? ***

Thanks.

sulfericacid
 
sorry about the title of the question, haven't been here in a while :(

sulfericacid
 
It looks like it's searching the html for the number of hits a search produced. The number represents the distance (offset) of the number from... something. The search engine websites may have changed their wording since that script was written, because I can't seem to find any correlation.
 
are you saying it's actually searching the pages for the numbers?

sulfericacid
 
That's what it seems like.. check out this comment:

#the following string represent the criteria needed to parse through
#the HTML page to find link popularity

what is this script for exactly? It's hard to tell without seeing the entire script.

 
This is a link popularity script. The user inputs a url and it will search a few search engines, the one listed above, and will tell you how many times your page was found.

Take a look at the running script on my page, sorry since i paid for the script I won't put the source out here, .

The script runs without errors, which is should. I bought this script over a year ago and it worked PERFECTLY. I lost the script over 8 months ago and just found it 2 days ago and tested it again. The script runs without errors but when you see the outcome/results, something isn't right. You can search any url and it will only show up under the MSN column. I looked through the source and the only thing I could think of which might have changed over the months...not my codes, it must be something which has to do with those numbers.

Maybe those numbers have to be changed so it can split something right, i'm not sure, that's why i posted this, i need to know what that segment does. Can you or anyone else check out that page to see what it does, look at the results, and see why it might be acting like this? It USED to work when i originally got it and the source code hasn't changed.

If you think you now why from the source, i'd love any assitance i could get! if you think you can help if you see the entire source, email me at venimfrogtongue@earthlink.net so i can email it to you (don't want it lying here so people can take it).

Thanks so much!

sulfericacid
 
ok.. I can see what it's doing now. It's looking for a sentence starting and ending with the values in
%startindexstring and %endindexstring

in the case of MSN - the sentence to look for is:
&quot;of about 841 containing&quot;
Code:
%startindexstring = &quot;of about&quot;  (a sentence that starts with &quot;of about...&quot;
%endindexstring = &quot;containing&quot;   and ends with &quot;containing&quot;)

if you count from the word &quot;of&quot; (starting with zero), 841 is located at offset 8 (%offsetstr)

Code:
of about 841 containing&quot;
012345678


try changing these values for Altavista in the last 3 sections and see if it works..
Code:
&quot;Altavista&quot;,&quot;AltaVista found&quot;,

&quot;Altavista&quot;,&quot;results:&quot;,

&quot;Altavista&quot;,&quot;15&quot;,

Whoever wrote the script should support it if you paid for it - if they're still around, but you should probably be able to figure it out by going to each search engine to see how they print out the number of matches. MSN must be the only site that didn't change their wording. If the altavista one works, let me know and I can tell you how to change the others if you have trouble with it.

Hope this works!

I'm not sure why the author did it this way.. I would have done it differently, but maybe they had a reason.
 
Ok, nothing changed but that may be because I didn't do what you expected. Below is what I am currently using:

#the following string represent the criteria needed to parse through
#the HTML page to find link popularity
%hitstring=( &quot;MSN&quot;,&quot;of about&quot;,
&quot;Lycos&quot;,&quot;articles were found&quot;,
&quot;Altavista&quot;,&quot;We found \\d+ result&quot;,
&quot;HotBot&quot;,&quot;WEB\ RESULTS\ </SPAN> \ \\d+\ Matches&quot;,
&quot;Google&quot;,&quot;Results \<b\>1\<\/b\> - \<b\>\\d+\<\/b\> of about \<b\>\\d+&quot;,
&quot;AOL&quot;,&quot;\\(1 - \\d+ of \\d+&quot;,
&quot;IWON&quot;,&quot;var IWtotalresults = \\d+&quot;,
&quot;WISENUT&quot;,&quot;\<B\>Results\<\/B\> : \\d+&quot;,
);

%startindexstring=(&quot;MSN&quot;,&quot;of about&quot;,
&quot;Lycos&quot;,&quot;\<b\>&quot;,
&quot;Altavista&quot;,&quot;AltaVista Found&quot;,
&quot;HotBot&quot;,&quot;WEB\ RESULTS\ </SPAN> \ \\d+\ Matches&quot;,
&quot;Google&quot;,&quot;of about \<b\>&quot;,
&quot;AOL&quot;,&quot; of &quot;,
&quot;IWON&quot;,&quot;=&quot;,
&quot;WISENUT&quot;,&quot;\<B\>Results\<\/B\> :&quot;,
);


%endindexstring=(
&quot;MSN&quot;,&quot;containing&quot;,
&quot;Lycos&quot;,&quot;\<\/b\>&quot;,
&quot;Altavista&quot;,&quot;results:&quot;,
&quot;HotBot&quot;,&quot;Matches&quot;,
&quot;Google&quot;,&quot;\<\/b\>. Search&quot;,
&quot;AOL&quot;,&quot;\)&quot;,
&quot;IWON&quot;,&quot;;&quot;,
&quot;WISENUT&quot;,&quot;document&quot;,
);

#this contains the number of characters in the string before
#the number of hits can be dissected
%offsetstr=(
&quot;MSN&quot;,&quot;8&quot;,
&quot;Lycos&quot;,&quot;3&quot;,
&quot;Altavista&quot;,&quot;15&quot;,
&quot;HotBot&quot;,&quot;35&quot;,
&quot;Google&quot;,&quot;12&quot;,
&quot;AOL&quot;,&quot;4&quot;,
&quot;IWON&quot;,&quot;1&quot;,
&quot;WISENUT&quot;,&quot;17&quot;,
);



-----------------------------------------
There is one more segment that may/may not have to do with anything, i really highly doubt it since it's just the link to their submission page, but...

%searchengines=( &quot;MSN&quot;,&quot; &quot;Lycos&quot;,&quot; &quot;Altavista&quot;,&quot; &quot;Google&quot;,&quot; &quot;AOL&quot;,&quot; &quot;IWON&quot;,&quot; &quot;WISENUT&quot;,&quot; #&quot;HotBot&quot;,&quot; );

------------------------------------
I don't know who the author is anymore, it was done in a chatroom. At the time it worked fine, I didn't care anything about the code since it worked :)

Am I doing it right (from what you said)?

Thanks!!

sulfericacid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top