hello-network.py


#!/usr/bin/python
# A script for greeting every server on the Internet.
import iptools, httplib
for ip in iptools.IpRangeList('0.0.0.0/0'):
try:
print "Greeting " + ip
cx = httplib.HTTPConnection("%s:80" % ip)
cx.request("POST", '/', "message=Hello+world!")
except:
pass

# From Speaking Code: Coding as Aesthetic and Political Expression
# code by Alex McLean.
# Video of Franco Bifo Berardi reading this at
# http://vimeo.com/48294959.
# Ignore the description as the code is not random nor is it html.

Leave a Reply