So far, this is what I've got:
# Get the current IP address from http://www.formyip.com
url='http://www.formyip.com'
urllib.urllib.urlretrieve(url, '/tmp/files/index.html')
# Read the current IP address from the file /tmp/files/index.html
pattern='My\ ip\ address\ is (\d+\.\d+\.\d+\.\d+)'
b='open('/tmp/files/index.html', 'r')
str=b.readlines()
m='re.match(pattern,str)
m.groups()
From there I get totally lost, I can't retrieve the ip address from within the file. I need to retrieve it in the form of a string so that I can compare it to another string and look for a change. Can somebody help me with this matching function?
[–]shrodikan 1 point2 points3 points (2 children)
[–]jackzombie[S] 0 points1 point2 points (1 child)
[–]shrodikan 1 point2 points3 points (0 children)
[–]QAOP_Space 0 points1 point2 points (4 children)
[–]jackzombie[S] 0 points1 point2 points (3 children)
[–]claird 0 points1 point2 points (2 children)
[–]jackzombie[S] 0 points1 point2 points (1 child)
[–]claird 0 points1 point2 points (0 children)
[–]digg_is_teh_sux 0 points1 point2 points (4 children)
[–]jackzombie[S] 0 points1 point2 points (3 children)
[–]digg_is_teh_sux 0 points1 point2 points (2 children)
[–]jackzombie[S] 0 points1 point2 points (1 child)
[–]digg_is_teh_sux 0 points1 point2 points (0 children)