Are you sure you're setting the header correctly? The following works for me.
$r = new HTTP_Request($url); $r->addHeader('User-Agent', 'User Agent String'); $r->sendRequest();
Mark
-----Original Message----- From: wikitech-l-bounces@wikimedia.org [mailto:wikitech-l-bounces@wikimedia.org]On Behalf Of The Hooded Man Sent: December 7, 2005 3:42 PM To: wikitech-l@wikipedia.org Subject: [Bulk] [Wikitech-l] Access Denied from Wikipedia's proxies
I'm trying to access a Wikipedia page with the PEAR::HTTP_Request class in PHP. When I try to access http://en.wikipedia.org/, the request is as follows:
ERROR The requested URL could not be retrieved
While trying to retrieve the URL: http://en.wikipedia.org/
The following error was encountered:
- Access Denied. Access control configuration prevents your request from
being allowed at this time. Please contact your service provider if you feel this is incorrect.
Your cache administrator is wikidown@bomis.com.
Generated Wed, 07 Dec 2005 20:34:13 GMT by srv6.wikimedia.org (squid/2.5.STABLE12)
It's not that my user agent is blocked, because it's sending: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1). I would send my own user agent string and not fake another, but from what I hear that's not necessary for most minor projects such as mine.
Could my IP be blocked, and if so, could I find out why? If not, are there any little tricks I need to know about a PHP script connecting to Wikipedia?
Thank you,
-HoodedMan "Wind to thy wings. Light to thy path. Dreams to thy heart."
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l