Skip to content

Instantly share code, notes, and snippets.

@tristanwietsma
Created June 12, 2014 15:59
Show Gist options
  • Select an option

  • Save tristanwietsma/356dc9c516ca5f867941 to your computer and use it in GitHub Desktop.

Select an option

Save tristanwietsma/356dc9c516ca5f867941 to your computer and use it in GitHub Desktop.
Bit.ly USA.gov feed
import socket, time
# http://www.usa.gov/About/developer-resources/1usagov.shtml
s = socket.socket()
s.connect(('developer.usa.gov', 80))
s.send('GET /1usagov HTTP/1.0\n\n')
s.setblocking(False)
while True:
try:
data = s.recv(1024)
print data
except:
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment