Part I of this post series can be found here.
3. Requirements for the script:
The script shall have a lower limit to start bidding i.e. the script should not start bidding if the actual price in the bid hasn’t crossed a set limit.
The script shall have an upper limit to bidding i.e. it shall stop bidding if the bid price crosses certain limit.
The script shall bid a fixed number of times i.e. the script shall stop bidding if the total number bids placed by it exceeds a preset number even if the upper limit has not been reached.
The script shall place a bid only if the time to bid is less than a predetermined number of seconds.
The script shall not place a bid if the last bidder is self.
The script shall stop bidding if there is a winner.
4. Preparation for the script:
This is a bit tricky because there is no one-script-works-on-all-auction-site solution. There would be one if only all penny auction sites are built by the same team and used same code. So, this is where the basic of HTML will come into play. Look up the code using inspect element and find out the following.
Item identifier - there might not be a separate identifier for this. Some sites use a number for this and just append it to all other identifiers mentioned below.
Current winning bidder identifier.
Identifier or class used to denote the winner when the bid ends. This can be found when the bidding ends. Usually there will be a style (class) applied to the timer or winner DIV element. Just keep the Inspect Element window open and notice the change at the end of the bid.
The following is a bare-bone structure. The actual site’s code might have a lot more style/class and other elements in between.
<div id="MainBiddingDIV"> <div id="Price_XXXX">$0.01</div> <div id="Timer_XXXX">00:00:22</div> <div id="CurrentWinningBidDIV"> <img src="user_image.png" id="UserImage"> <div id="Winning_XXXX">WinningBidderName</div> </div> <div> <input type="button">Place A Bid</a> OR [ <a href="">Place a bid</a> ] </div> </div>
The above code doesn’t have styles assigned whereas the penny auction sites will definitely have classes assigned. The bidding button can be any element, just inspect element and find out what it is and what it does, which method it calls etc.
Building the script and using it in the next post.