okfn / dataproxy

Web application (targeted at appengine) to proxy data from certain data types into a JSON-P data type so that users can create mashups against remote data sets.
http://jsonpdataproxy.appspot.com/
Other
75 stars 24 forks source link

Clean up get_resource_length #13

Closed rufuspollock closed 11 years ago

rufuspollock commented 11 years ago

We have a huge method for getting the content length when all we need is:

urlfo = urllib.urlopen(url)
urlfo.headers.get('content-length', None)

NB: urllib2.urlopen will follow redirects for you