# -*- coding: utf-8 -*-
#######################
# WARNING
# Running this code sample will cost you Browshot credits
#######################

from browshot import BrowshotClient

browshot = BrowshotClient('my_api_key')


info = browshot.simple_file('http://www.google.com/', 'google-640.png', { 'width': 640, 'height': 480 })

if info['file'] == '' or info['code'] != 200:
  print "Screenshot failed"
else:
  print "Thumbnail saved at %s" % info['file']
