In [10]:
optxt = open('brief.txt', 'r')

In [11]:
filtxt = optxt.read()

In [12]:
filtxt


Out[12]:
'ok\nwe go to website - basically - sorry@\n\n\n\nlocalhost/redirect.py? everythingelse.html\nreferal header that was in the request\nif referal header:\nprint html \nthen javascript function to refresh and go to original url.\nif no referal header:\ngenerate htm header 302 redirect to that url. \n \n\n'

In [12]:
filtxt.

In [14]:
mksit = open('index.html', 'w')

In [14]:


In [44]:
import requests

In [55]:
opartz = requests.get('http://artcontrol.me')

In [56]:
headon = opartz.headers

In [57]:
headon


Out[57]:
CaseInsensitiveDict({'content-encoding': 'gzip', 'transfer-encoding': 'chunked', 'set-cookie': 'PHPSESSID=bp0npmihkpt3qsc9fm7r8v3t95; path=/', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'vary': 'Accept-Encoding', 'server': 'Apache', 'link': '<http://wp.me/1LQEk>; rel=shortlink', 'pragma': 'no-cache', 'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'date': 'Sun, 15 Jun 2014 08:31:52 GMT', 'content-type': 'text/html; charset=UTF-8', 'x-pingback': 'http://artcontrol.me/xmlrpc.php'})

In [52]:
print headon['server']


gws

In [50]:
checkser = headon['server']

In [50]:


In [54]:
if checkser is None:
    print ('it is none')
    
else:
    print ('You have a referal header')


You have a referal header

In [ ]: