FWIW, depending on just how precisely you want to mimic Firefox, setting the User-Agent may not be enough (though that is probably sufficient for most cases). To make your script to look like 'normal' web browsing, you might want to set an appropriate Referer and make additional requests for the rest of the page content (Javascript/CSS/Images/Flash/etc). Something to thing about, though perhaps not appropriate to your particular situation.