Go Back   WhatIsMyIP.comŽ Forum > All About Code > Coding Problems

Notices

Closed Thread
 
Thread Tools Display Modes
Old 05-01-2012, 02:01 AM   #1
kosinski1
Member
 
Join Date: May 2012
Posts: 3
kosinski1 is on a distinguished road
Default Automation URL gives different results in Perl

If I visit the automation URL (http://automation.whatismyip.com/n09230945.asp) in a browser like Safari, I get the correct IP address for my machine (always 70.231.xxx.yyy, where xxx and yyy can change based on DHCP).

If I visit it in a Perl script using HTTP::Request::Common, occasionally the IP address will come back as 205.248.102.82. Most of the time it works, but sometimes it returns this bogus IP. The Perl script identifies itself with a user-agent = 'libwww-perl/6.03'.

I have a hard time imagining that the automation URL cares what your user agent is, but I have no other explanation for this behavior. Anyone else seeing this? Any idea what's going on?
kosinski1 is offline  
Old 05-01-2012, 10:00 AM   #2
wimiadmin
Administrator
 
wimiadmin's Avatar
 
Join Date: May 2008
Location: Pigeon Forge, TN
Posts: 1,511
wimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to behold
Default

hi kosinski1,

Thanks for letting us know. We've recently implemented CloudFlare to help us serve up pages faster. They're probably not liking your UserAgent and presenting a CAPTCHA which you can't see.

Try setting your UA to something common like:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0

Let me know how that works out.
__________________
Brian
Please Search Before Posting
wimiadmin is offline  
Old 05-01-2012, 03:03 PM   #3
kosinski1
Member
 
Join Date: May 2012
Posts: 3
kosinski1 is on a distinguished road
Default

Cool. I'll give that a try. Thanks!
kosinski1 is offline  
Old 05-01-2012, 03:14 PM   #4
kosinski1
Member
 
Join Date: May 2012
Posts: 3
kosinski1 is on a distinguished road
Default

Looks like you also added some code that now rejects requests from libwww-perl/6.03. I set the UA as you suggested and things seem to work. Since the problem is intermittent I'll need to monitor it for a while to make sure it's fixed, but if you don't hear from me again you can assume it's all good.

Thanks again!
kosinski1 is offline  
Old 05-01-2012, 03:19 PM   #5
wimiadmin
Administrator
 
wimiadmin's Avatar
 
Join Date: May 2008
Location: Pigeon Forge, TN
Posts: 1,511
wimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to behold
Default

You're the second person to confirm the UA fix. So, this will probably be a permanent fix. But please monitor and let us know if something goes wrong.
__________________
Brian
Please Search Before Posting
wimiadmin is offline  
Old 05-03-2012, 02:59 AM   #6
Sitron_NO
Member
 
Join Date: May 2012
Posts: 1
Sitron_NO is on a distinguished road
Default

I have the same problem using Python with urllib2:
Code:
ip = urllib2.urlopen("http://automation.whatismyip.com/n09230945.asp").read()
Since Telenor is my ISP, I know which IP-blocks I can expect, but I always get an IP from belonging Hotmail :-)

Copy-paste from Wireshark:
Code:
GET /n09230945.asp HTTP/1.1
Accept-Encoding: identity
Host: automation.whatismyip.com
Connection: close
User-Agent: Python-urllib/2.6

HTTP/1.1 200 OK
Server: cloudflare-nginx
Date: Thu, 03 May 2012 06:28:23 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
Cache-Control: private
X-Powered-By: ASP.NET
Vary: Accept-Encoding
Set-Cookie: __cfduid=d0b909e53cd8a9f3851d018c2eb1fc87c1336026503; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.whatismyip.com
Set-Cookie: __cfduid=d0b909e53cd8a9f3851d018c2eb1fc87c1336026503; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.automation.whatismyip.com

c
65.52.66.156
0
Using Firefox, wget or Chrome gives me the correct address.
Sitron_NO is offline  
Old 05-03-2012, 09:50 AM   #7
wimiadmin
Administrator
 
wimiadmin's Avatar
 
Join Date: May 2008
Location: Pigeon Forge, TN
Posts: 1,511
wimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to behold
Default

Hi Sitron,

Try setting your UA to something common like:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
__________________
Brian
Please Search Before Posting
wimiadmin is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:39 PM.


What Is My IP

Join WhatIsMyIP.com on Facebook Follow WIMI on Twitter

Need IP address location detection service? Get it from IP2Location.com now.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright - WhatIsMyIP.comŽ