Not too long ago eBay discovered that the removal of the sort by bids feature forces customers to spend much more time on their site. What an absolute nightmare.
I have thus written a free program with AutoIt called Sesbyb to fix this situation. With this program the items of your eBay “BuyItNow” search will be sorted according to their sales rank, meaning items with most bids will appear first in the list.
Supported options include:
– Number of results to sort
– Local or global search
– Min and max price
Planned are the options to enter your own search url as well processing search results of more than 200 items if there is demand for thos features. Furthermore the whole string seperation process will be overhauled.
Below you find a screenshot of what a search result from Sesbyb looks like:
Download Sesbyb – The Zip file includes an executable as well as the source code.
For convenience I also included the source code below. Suggestions and improvements are welcome.
;Sesbyb - Sort Ebay Search by Bids #include <Inet.au3> #include <String.au3> #include <ArraySortMulti.au3> HotKeySet("{ESC}", "Terminate") $file = FileOpen("sesbyb-result.html", 2) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $AdvancedSearchString = "http://www.ebay.co.uk/dsc/i.html?_nkw=hansuelihansueli&_sacat=See-All-Categories&_adv=1&LH_TitleDesc=1&_sadis=200&LH_BIN=1" $searchTerm = InputBox("What do you want to Search?", "Enter keywords", "Chilli Seeds") $searchTerm = StringReplace($searchTerm, " ", "+") $searchURL = StringReplace($AdvancedSearchString, "hansuelihansueli", $searchTerm) $searchAmount = InputBox("Number of Results wanted?", "From 1 to 500", "50") If $searchAmount >= 500 Then $searchAmount = 500 ElseIf $searchAmount <= 1 Then $searchAmount = 1 EndIf $searchURL = $searchURL & '&_ipg=' & $searchAmount $searchLocation = InputBox("Search Locally or Globally?", "1 for Local, 2 for Global", "1") If $searchLocation >= 2 Then $searchLocation = 2 ElseIf $searchLocation <= 1 Then $searchLocation = 1 EndIf $searchURL = $searchURL & '&LH_PrefLoc=' & $searchLocation $searchCountry = InputBox("Ebay Site", "Which ebay site would you like to search?", "http://www.ebay.co.uk") $searchURL = StringReplace($searchURL, "http://www.ebay.co.uk", $searchCountry) $searchMinPrice = InputBox("Minimum Price?", "From 0 to 1000000", "0") If $searchMinPrice >= 1000000 Then $searchMinPrice = 1000000 ElseIf $searchMinPrice <= 0 Then $searchMinPrice = 0 EndIf $searchMaxPrice = InputBox("Maximum Price?", "From 0 to 1000000", "1000000") If $searchMaxPrice >= 1000000 Then $searchMaxPrice = 1000000 ElseIf $searchMaxPrice <= 0 Then $searchMaxPrice = 0 EndIf $searchURL = $searchURL & '&_mPrRngCbx=1' & '&_udlo=' & $searchMinPrice & '&_udhi=' & $searchMaxPrice ClipPut( $searchURL) $searchResult = _INetGetSource($searchURL) $i = '<div id="ResultSetItems"' ; used to be <div id="ResultSet" but Ebay changed the ID $ResultsExtraction = StringSplit($searchResult, $i, 1) ;[1] = index etc, [2] = search results ;_ArrayDisplay( $ResultsExtraction) $i = '<a name="item' $ResultsArray = StringSplit($searchResult, $i, 1) ; For $i = 1 To UBound($ResultsArray) - 1 $ResultsArray[$i] = '<a name="item' & $ResultsArray[$i] ;MsgBox( 0, "", $ResultsArray[$i]) Next ;Get total amount of search results, currently source looks like: <span>12,316</span> $SearchTotalResultsArray = StringSplit($searchResult, '<span>',1) $NumberOfTotalResults = StringLeft($SearchTotalResultsArray[2], StringInStr($SearchTotalResultsArray[2], '</span>') -1 ) ;Clean up $ResultsArray[1] = "" $ResultsArray[UBound($ResultsArray) - 1] = StringLeft($ResultsArray[UBound($ResultsArray) - 1], StringInStr($ResultsArray[UBound($ResultsArray) - 1], "/tr></table>")) $ResultsArray[UBound($ResultsArray) - 1] = $ResultsArray[UBound($ResultsArray) - 1] & "/tr></table>" _ArrayDisplay($ResultsArray) ;Get Item URL's Dim $ItemLinks[UBound($ResultsArray)] For $i = 2 To UBound($ResultsArray) - 1 $StringBetweenResult = _StringBetween($ResultsArray[$i], '<a href="', '" ", $ItemLinks[$i]) ;ClipPut( $ItemLinks[$i]) Next ;Create 2D array with column for sales count Dim $ResultsArray2D[UBound($ResultsArray)][2] For $i = 0 To UBound($ResultsArray) - 1 $ResultsArray2D[$i][0] = $ResultsArray[$i] $ResultsArray2D[$i][1] = 0 Next If $NumberOfTotalResults <= $searchAmount Then ProgressOn("Sesbyb - Searching Ebay - To cancel press ESC", "Analyzing " & $searchAmount & " of the " & $NumberOfTotalResults & " results found", "0 %") Else ProgressOn("Progress - Searching Ebay - To cancel press ESC", "Analyzing " & $NumberOfTotalResults & " of the " & $NumberOfTotalResults & " results found", "0 %") EndIf For $i = 2 To UBound($ResultsArray) - 1 $ItemPage = _INetGetSource($ItemLinks[$i]) ;Check if sold any If StringInStr($ItemPage, " sold</a>") Then $sl = StringLeft($ItemPage, StringInStr($ItemPage, " sold</a>") - 1) $sl = StringRight($sl, 10) $sl = StringRight($sl, StringLen($sl) - StringInStr($sl, ">")) $ResultsArray2D[$i][1] = $sl Else $ResultsArray2D[$i][1] = 0 EndIf ;MsgBox(0, "", $ResultsArray2D[$i][0]) ;MsgBox(0, "", $ResultsArray2D[$i][1]) ProgressSet(Round($i / (UBound($ResultsArray) - 1) * 100), Round($i / (UBound($ResultsArray) - 1) * 100) & " % done") Next ProgressOff() Local $COL0 = "COL0,ASC,STRING" Local $COL1 = "COL1,DESC,NUMERIC" _ArraySortMulti($ResultsArray2D, $COL1, $COL0) For $i = 0 To UBound($ResultsArray) - 1 $ResultsArray2D[$i][0] = StringReplace($ResultsArray2D[$i][0], '</tr></table>', '<td>Bids: ' & $ResultsArray2D[$i][1] & '</td></tr></table>') Next ;$SortedSearchResults = StringReplace($SortedSearchResults FileWrite($file, '<html>' & @CRLF) FileWrite($file, '<head>' & @CRLF) FileWrite($file, '<link rel="stylesheet" type="text/css" href="search.css" />' & @CRLF) FileWrite($file, '</head>' & @CRLF) For $i = 0 To UBound($ResultsArray) - 1 FileWrite($file, $ResultsArray2D[$i][0] & @CRLF & @CRLF) Next FileWrite($file, '</html>' & @CRLF) FileClose($file) ShellExecute("sesbyb-result.html") Func Terminate() Exit 0 EndFunc ;==>Terminate
My pc wont boot the program… Says: ( High Malware Threat )
Quarantined..
Hi Sam, first of all it’s not malware but some antivirus programs classify autoit scritps as possible threats and thus quarantine them. It’s called a false positive. Having said that, I’d never recommend trying to run a program you download of the internet. The source is there so just install autoit and run the script yourself, you might also learn something in the process! Cheers
Do you have it for mac? I only have a mac…
AutoIt is only for windows. You can either run it under a virtual pc or there are some other ways how you can run windows programs on a mac. Cheers
hello there. when i try to run it, errors came out. please refer to attachment.
Hi,
Seems ebay changed some code. Made a new version with some bugfixes, enjoy.
Over at WatchCount.com you can search and sort by most bids!