Im developing an auction site like ajax penny auction. My problem is how to create autobidder in my application similar to the one in penny auction.Ive seen that their autobidder is taking one bid in each second. How can I do such a task? Is it done by scheduling a cron in every second ? or is there any other convenient method for that ?
please help me..
thanks in advance..
The way I'd do it is when a person bids, store that bid as their maximum bid in their profile.
Then, I'd get a list of all the bidders that have bidded and see if their maximum bid is higher than the current bid. If so, I would then go through each bidder and increment the current bid by 1 until you end up with one bidder.
Hope this helps?
This is my criteria..
I want to create an auto bidder, some thing like in this auction site for my penny auction site.
Online Auction | Online Shopping Cart | Online Bidding | Online Auction India | Online Bidding India | Online Shopping Cart India :: Ezeebids
Penny Auction Demo
In this site we can create auto bid by specifying "min bid amount" , "max bid amount" and
"maximum no of bids".
One person setup an auto bid with following values.
min bid amount : 10.24
max bid amount : 10.75
maximum no of bids : 50
And another person setup an auto bid with following values.
min bid amount : 10.25
max bid amount : 10.56
maximum no of bids : 31
When the auction reaches at 10.24, the auto bid set by for first person will place bit at 10.25.
After A SECOND bid 10.26 will be placed by auto bidder from second person.
In the NEXT SECOND 10.27 will be placed from first person again. The loop will continue to
10.57 from first person. These auto bidders place one bid in each second.
When an auto bid is placed the auction should EXTEND by 15 seconds.
I've done the code to "auto bid", But in my code all auto bidders work continuously and the
auto bidder will reach 10.57 with current leader as person 1 within in a second. Because i
wrote a loop to do the auto bidding.
My problem is how to place only one auto bid in a second ? The site I refered above are
placing only one auto bid in a second.
Do I ve to setup a cron job for this ? Or is there any other way to do this ?
I personally think your over thinking it. You should only need to store a maximum bid.
You shouldn't need to do it every second, you could do it instantly as soon as someone else bids. This way, you won't need a cron job to run.
Is this meant to be in your own site or another?
In your own site, as Gavin said, make it a part of the bid processing. When someone bids, just run the check to see if they need to be outbid. (PS: This is a rather underhanded thing to do, and is the reason i dont use penny auction sites).
On another, this almost certainly violates the terms and conditions of said site, and as such cannot be given help on SitePoint.