From: Dossy Date: 2002-09-19T10:26:38+09:00 Subject: Re: Semi-OT: Web issues On 2002.09.19, Hal E. Fulton wrote: > > And no, I don't blame you if you don't bother. If this isn't the most pathetic guilt trip I'd ever heard! :-) Since I'd just spent the last two days writing web screen-scrapers as a favor to a friend -- part of which was defeating some website's attempt to limit access to some portions of their site -- your challenge wasn't very tough. :-) Here's the skinny: The CafePress account side can either be accessed via SSL or non-SSL. Here are the cookies that the site sets: Cookie: fcP=C=0&T=1032397984660; ASP.NET_SessionId=ptqg1xrfd5ivxinux3ai2art So, we've got "fcP" which is set to "C=0" and "T" which is set to what looks like a Unix timestamp: $ date Wed Sep 18 21:22:48 EDT 2002 $ ruby -e 'p Time.at(1032397984660)' -e:1:in `at': bignum too big to convert into `int' (RangeError) from -e:1 Hmm. It definitely looks like Unix time, but too many digits. Lets take the least significant ones off: $ ruby -e 'p Time.at(1032397984)' Wed Sep 18 21:13:04 EDT 2002 There you go. So, there's some server-side state that's being maintained using the ASP.NET_SessionId cookie to associate your browser to the server-side session. Then there's some client-side timestamp and some other misc. cookie. So, you'll have to write your auto-uploader to hit the CafePress login page in order to get the ASP.NET_SessionId. Once you've got that, then go on your merry way. Ruby's Net::HTTP makes this pretty easy. -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)