Spoof User-agent:
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sat, 10 Nov 2012 20:12:00 +0000 (20:12 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sat, 10 Nov 2012 20:12:00 +0000 (20:12 +0000)
members.py

index 633b3435f18e6a794c686df63ea048b2ebb7a422..8c7aac217a0ed1e2769848909453a4ca375bc37e 100755 (executable)
@@ -52,6 +52,8 @@ Note that in last 2 FLOOD lines exemple, NewField1 is 102 that is different from
 #BASE_URL
 DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
 
+USER_AGENT="Mozilla/5.0 (X11; U; Linux.i686; en-US; rv:1.9.1.16) Gecko/20121020 Iceweasel/3.5.16 (like Firefox/3.5.16)"
+
 def read_config(config_dir):
     '''
     That function will read config.py in .fourmizzz directory
@@ -97,6 +99,7 @@ def httpopen(url, post_data=None):
         cookiejar = CookieJar()
         __opener__ = urllib.request.build_opener()
         __opener__.add_handler(urllib.request.HTTPCookieProcessor(cookiejar))
+        __opener__.addheaders = [('User-agent', USER_AGENT)]
     http_response = __opener__.open(url, post_data)
     return http_response