Login Register






Challenge: Python IP Checker filter_list
Author
Message
Challenge: Python IP Checker #1
Your mission is to write a python script that gets the users external IP and then saves it to a local text file.

I use checkip.dyndns.org to find out my external IP you can use alternatives!

I'll re-write my own personal script for this in python.
[Image: 9JVyFsC.png]
Sig by @Symadox

XMPP: Mi5@DukGo.com

Reply

RE: Challenge: Python IP Checker #2
Done.
It's probably the same as you though.
Code:
import urllib2 i=urllib2.urlopen("http://myip.dnsdynamic.org/").read() f=open("i.txt", "w") f.write(i) f.close()

[+] 1 user Likes m0dem's post
Reply

RE: Challenge: Python IP Checker #3
this isn't python, but it works (school's ip, I don't care who has it)
Code:
curl 'https://api.ipify.org'|tee 'ip.txt'

in python:
Code:
from requests import get open('ip.txt','w').write(get('https://api.ipify.org').text)
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Challenge: Python IP Checker #4
How is this a challenge?

Code:
import urllib2 ip=urllib2.urlopen('https://icanhazip.com').read() f=open('ip.txt', 'w') f.write(ip) print ip+"Written to file 'ip.txt'" f.close()

EDIT: just realized my solution looks almost exactly like m0dem's, guess ill make it seem a little different

Reply

RE: Challenge: Python IP Checker #5
(12-16-2015, 03:00 PM)meow Wrote: How is this a challenge?

Code:
import urllib2 ip=urllib2.urlopen('https://icanhazip.com').read() f=open('ip.txt', 'w') f.write(ip) print ip+"Written to file 'ip.txt'" f.close()

EDIT: just realized my solution looks almost exactly like m0dem's, guess ill make it seem a little different

It doesn't have to look different. It just has to work. Smile

Reply