GaijinPunch has asked for the wisdom of the Perl Monks concerning the following question:

Hey monks

I know, I suck. I don't know how md5 works per se. I assumed it worked with keys like SSH, but after digging through the Digest:MD5 module, it doesn't seem that way.

What I'm trying to achieve, is I want a script that will bid for me on an auction site (Yahoo Japan, not Ebay). Basically, there's a form on one page, which you fill in (bid amount + password), and on the next page, in the URL, is all the necessary variables in the URL, and of course, the confirm button. I can see in the URL a variable called 'passwd', which is taken from the previous pages text input. However, it's obviously encoded (always 32 characters). There is one hidden value passed by the form called ".challenge", which I would assume is the key. It is the only thing different in the form after every refresh. The 'passwd' value in the URL on the 2nd page is always different after every refresh as well. Here's a look at the HTML form (in Shift-JIS, if the mojibake bothers you).
<FORM METHOD="POST" ACTION="http://page14.auctions.yahoo.co.jp/jp/show +/bid_preview?" onSubmit="return hash(this, 'http://page14.auctions.ya +hoo.co.jp/jp/show/bid_preview');"> <input type=hidden name=".challenge" value="n_8nieof8Wku2cgXhWCS9jHtS7 +wr" > <INPUT TYPE="hidden" NAME="ItemID" VALUE="s18658837"> <INPUT TYPE="hidden" NAME="itemStyles" VALUE="&u=;brand_brand_jp&tp="> <INPUT TYPE="hidden" NAME="login" value="myaccountid"> <INPUT TYPE="hidden" NAME="cc" VALUE="jp"> <INPUT TYPE="hidden" NAME="md5"> <INPUT TYPE="hidden" NAME="Quantity" VALUE="1"> <TR><TD> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" WIDTH="100%"> <TR><TD COLSPAN="2" BGCOLOR="ffcc33" NOWRAP><FONT COLOR="333333"> <B>入札する</B><FONT SIZE=-2>(数字は半角で入力)</FONT></FONT></TD></ +TR> <TR><TD COLSPAN="2" ALIGN="center"><IMG SRC="http://img.yahoo.co.jp/i/ +space.gif" WIDTH="1" HEIGHT="2"></TD></TR> <TR><TD COLSPAN="2"><SMALL><FONT COLOR="#dd0000"> 1 円から入札できます </FONT></SMALL></TD></TR> <TR> <TD ALIGN="right" NOWRAP><SMALL> <A HREF="http://help.yahoo.co.jp/help/jp/auct/bid/bid-13.html">最高入 +D額</A>: </SMALL></TD> <TD NOWRAP><FONT COLOR="000000"><INPUT TYPE="text" NAME="Bid" SIZE="9" +><FONT SIZE="-2"> 円</FONT></FONT></TD> </TR> <TR> <TD ALIGN="right" NOWRAP><FONT COLOR="000000"><SMALL>パスワ[ド:</SMA +LL></FONT></TD> <TD><INPUT TYPE="password" SIZE="10" NAME="passwd" maxlength="32"></TD +> </TR> <INPUT TYPE="hidden" NAME="bidType" VALUE="1000"> <TR><TD COLSPAN="2" ALIGN="center"> <INPUT TYPE="Submit" VALUE=" 確認 "><BR> <SMALL> <A HREF="http://help.yahoo.co.jp/help/jp/auct/bid/">入札のヘ‹プ</A> </SMALL> </TD></TR></TABLE> </TD></TR></FORM>
Here's a look at the next page's URL:
http://page14.auctions.yahoo.co.jp/jp/show/bid_preview?.challenge=n_8n +ieof8Wku2cgXhWCS9jHtS7wr&ItemID=s18658837&itemStyles=%26u%3D%3Bbrand_ +brand_jp%26tp%3D&login=myaccountid&cc=jp&md5=&Quantity=1&Bid=1&passwd +=32charactershere&bidType=1000&.hash=1&.js=1&.md5=1
Any love?

Replies are listed 'Best First'.
Re: md5 question
by Anonymous Monk on Mar 24, 2006 at 13:38 UTC

    Where's your code?

    In case you haven't started yet and need a pointer from where to go, use WWW::Mechanize. It abstracts web automation and form handling nicely.