Skip to content

Instantly share code, notes, and snippets.

@kostyll
Created March 17, 2015 08:56
Show Gist options
  • Save kostyll/042a62248c0d701373ce to your computer and use it in GitHub Desktop.
Save kostyll/042a62248c0d701373ce to your computer and use it in GitHub Desktop.
import json
import urllib
import requests
req = urllib.unquote('https://api.import.io/store/data/784a3159-a7c1-411b-8b9b-7c65743f23eb/_query?input/webpage/url=http%3A%2F%2Fmoz.com%2Ftop500&_user=44223ee8-63a2-45f2-9f3c-0e7aad8c38c9&_apikey=')+urllib.quote('BN2ukOiuoM4u9qIlrTt7TsPFe8RSQ7QgpaZLP/qUS1onqBx1aOsv4NgpRj0h03fpU02zAC+vQ6vIscKlcA2cSg==')
resp = requests.get(req)
resp.content
data = json.loads (resp.content )
data
data.keys()
data['results']
data['results'][0]
data['results'][1]
sites = map(lambda x: x['url_link'], data['results'])
sites
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment