Created
March 17, 2016 23:51
-
-
Save thadclay/1163c92acd703da0115e to your computer and use it in GitHub Desktop.
End Launches
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
#!/usr/bin/env python | |
#Hmmm... http://www.endclothing.com/media/us_sitemap.xml | |
import urllib2, zlib, json | |
url='https://launches.endclothing.com/api/products' | |
req = urllib2.Request(url) | |
req.add_header(':host','launches.endclothing.com');req.add_header(':method','GET');req.add_header(':path','/api/products');req.add_header(':scheme','https');req.add_header(':version','HTTP/1.1');req.add_header('accept','application/json, text/plain, */*');req.add_header('accept-encoding','gzip,deflate');req.add_header('accept-language','en-US,en;q=0.8');req.add_header('cache-control','max-age=0');req.add_header('cookie','__/');req.add_header('user-agent','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.120 Chrome/37.0.2062.120 Safari/537.36'); | |
resp = urllib2.urlopen(req).read() | |
resp = zlib.decompress(bytes(bytearray(resp)),15+32) | |
data = json.loads(resp) | |
for product in data: | |
for attrib in product.keys(): | |
print str(attrib)+' :: '+ str(product[attrib]) | |
print '\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you able to get this to run? Looks like there are a few issues with it.