Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jaredlockhart/78a9912a490f987f8d0670f0486dbe8c to your computer and use it in GitHub Desktop.
Save jaredlockhart/78a9912a490f987f8d0670f0486dbe8c to your computer and use it in GitHub Desktop.
In [83]: pprint.pprint(json.loads(requests.post('http://cloudvm.jaredkerim.com/', data=json.dumps({'urls': ['https://news.ycombinator.com']}), headers={'content-type':'application/json'}).content))
{u'error': u'',
u'urls': {u'https://news.ycombinator.com': {u'favicon_colors': [{u'color': [252,
100,
4],
u'weight': 0}],
u'favicon_url': u'https://news.ycombinator.com/favicon.ico',
u'image': u'https://news.ycombinator.com/y18.gif',
u'images': [{u'colors': [{u'color': [0,
0,
0],
u'weight': 0}],
u'height': 500,
u'url': u'https://news.ycombinator.com/y18.gif',
u'width': 500}],
u'original_url': u'https://news.ycombinator.com',
u'provider_url': u'https://news.ycombinator.com',
u'title': u'Hacker News',
u'url': u'https://news.ycombinator.com'}}}
Example app listening on port 3000!
requesting https://news.ycombinator.com
getting metadata for https://news.ycombinator.com
entering promise for https://news.ycombinator.com
promises [object Promise]
created dom for https://news.ycombinator.com
applying rules for https://news.ycombinator.com
applying rules for https://news.ycombinator.com
applying rules for https://news.ycombinator.com
applying rules for https://news.ycombinator.com
applying rules for https://news.ycombinator.com
applying rules for https://news.ycombinator.com
getting colors for https://news.ycombinator.com/favicon.ico
requesting content for https://news.ycombinator.com/favicon.ico
getting colors for https://news.ycombinator.com/y18.gif
requesting content for https://news.ycombinator.com/y18.gif
received binary color data for https://news.ycombinator.com/y18.gif
received binary color data for https://news.ycombinator.com/favicon.ico
found ico color 252,100,4
received colors for https://news.ycombinator.com
emitting metadata from promise for https://news.ycombinator.com
received data [{"url":"https://news.ycombinator.com","title":"Hacker News","favicon_url":"https://news.ycombinator.com/favicon.ico","image":"https://news.ycombinator.com/y18.gif","original_url":"https://news.ycombinator.com","provider_url":"https://news.ycombinator.com","favicon_colors":[{"color":[252,100,4],"weight":0}],"images":[{"url":"https://news.ycombinator.com/y18.gif","width":500,"height":500,"colors":[{"color":[0,0,0],"weight":0}]}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment