From anonymous, 10 Years ago, written in Python.
Embed
  1. ### Either:
  2. api = urllib2.urlopen("http://hackz.ch/parse/elitebnc.php")
  3. data = api.read()
  4. api.close()
  5. # API is a file-like object, data is text.
  6.  
  7.  
  8. ### Or:
  9. with closing(urllib2.urlopen("http://hackz.ch/parse/elitebnc.php")) as api:
  10.     data = api.read()
  11.