efilnikufecin
Member
From my understanding Fnord7 does not want to update his mallbot, and there's been problems getting the original code to work on another character/machine with another operator.
I wouldn't ask this question here, but it relates to KOL, and I think I may have a mistake either in my encoding of the URL, or possibly in the layout of the URL
I know nothing about the language the original mallbot was written in, but I am wanting upups pricegun to report a more accurate account value so I began work on a different mallbot program altogether.
Since the purpose of this bot will be to get the value of the item, and not a complete listing of all the items in the mall, I want to only search with a limit of 5, and calculate the average price for the quantity attainable from the top 5 stores where the value is not greater than 1mil in the cheapest store, and take the cheapest when the value is greater than 1mil. The problem I am having is I get 300 results when I search with a limit of 5.
Take the following example:
Note: the programing language uses ' instead of " around strings.
I expect to get 5 search results from that URL, but instead I get 300
The following is the entire code for the function in it's current incomplete debug state:
attached is the saved results from that function.
If anyone can tell me why I get 300 results instead of 5, or even suggest a possible reason I would greatly appreciate it.
I wouldn't ask this question here, but it relates to KOL, and I think I may have a mistake either in my encoding of the URL, or possibly in the layout of the URL
I know nothing about the language the original mallbot was written in, but I am wanting upups pricegun to report a more accurate account value so I began work on a different mallbot program altogether.
Since the purpose of this bot will be to get the value of the item, and not a complete listing of all the items in the mall, I want to only search with a limit of 5, and calculate the average price for the quantity attainable from the top 5 stores where the value is not greater than 1mil in the cheapest store, and take the cheapest when the value is greater than 1mil. The problem I am having is I get 300 results when I search with a limit of 5.
Take the following example:
Code:
server + 'searchmall.php?whichitem=%22seal-clubbing+club%22&searchform1=Search&cheaponly=on&shownum=5'
I expect to get 5 search results from that URL, but instead I get 300
The following is the entire code for the function in it's current incomplete debug state:
Code:
Procedure TForm1.ParseMallSearch(const ToSearch: string; var shopnum, limit, quant, price: string);
var
kolsource: string;
EncodedSearch: string;
TS: TStringList;
begin
EncodedSearch := urlencode(ToSearch);
kolsource := IDHTTP.Get(server + 'searchmall.php?whichitem=%22seal-clubbing+club%22&searchform1=Search&cheaponly=on&shownum=5'
);
//'searchmall.php?whichitem=%22' + EncodedSearch +
// '&searchform1=search&cheaponly=on&shownum=5'
//remove the leading and trailing unwanted html source from the returned string
kolsource := copy(kolsource, pos('<tr><td class=small>', kolsource), maxint);
kolsource := copy(kolsource, 0, pos('</table></center></td>', kolsource) - 1);
TS := TStringList.Create;
try
TS.Text := kolsource;
StatusLabel.Caption := inttostr(TS.Count);
TS.Add(EncodedSearch);
TS.SaveToFile(ExtractFilePath(Application.ExeName) + 'temp\test.html');
finally
TS.Free;
end;
end;
attached is the saved results from that function.
If anyone can tell me why I get 300 results instead of 5, or even suggest a possible reason I would greatly appreciate it.