InsideHTTP

Tuesday, July 05, 2005

New script sample...

I've posted a few new script samples to the FiddlerScript cookbook (see http://fiddlertool.com/Fiddler/dev/ScriptSamples.asp). The samples show how to use Fiddler to make automatic HTTP requests on your behalf.

This is an interesting use of Fiddler, and something which is quite powerful once you get the hang of it. You can basically use Fiddler as a poor-man's web-spider, creating offline versions of web photo albums, etc.

Note that if you want to dump hundreds of files at once, you'll likely run into a connection limit problem, where Fiddler will start to reject connections. You can easily throttle the requests like so...

var b=false;
while(!b){
try{
FiddlerObject.utilIssueRequest(s);
b=true;
}
catch(e){
var iT = Environment.TickCount + 10000;
FiddlerObject.StatusText = "Waiting for a 10 sec...";
// BUG: Really should set iT = (iT mod MAXINT32) here to prevent clock rollover bug.
while (iT > Environment.TickCount){
Application.DoEvents();
}
}

1 Comments:

  • Ed S. notes that there are some interesting behaviors every 24.9 days, when Environment.TickCount rolls over to 0.

    By Blogger Ericlaw, at 1:19 AM  

Post a Comment

<< Home