Created
June 12, 2014 15:59
-
-
Save tristanwietsma/356dc9c516ca5f867941 to your computer and use it in GitHub Desktop.
Bit.ly USA.gov feed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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