How to use the sma.files.thumbnail function in sma

To help you get started, we’ve selected a few sma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sdockray / sma / sma / archiver.py View on Github external
def summarize(self, force=False):
		if force or not self.title:
			try:
				self.title, self.summary, image_url = sponge.summary(self.url)
			except:
				image_url = None
				print "Failed extraction of ", self.url
			if image_url and (force or not self.image):
				self.image = sponge.image(image_url)
		# try and make thumbnail
		files.thumbnail(self.image)
github sdockray / sma / sma / sponge.py View on Github external
def screenshot(url, force=False):
	path = files.screenshot_path(url)
	if not os.path.exists(path):
		driver = webdriver.PhantomJS()
		driver.set_window_size(1024, 768)
		driver.get(url)
		driver.save_screenshot(path)
		files.square_crop(path)
	files.thumbnail(path)
	return path
	#print "Screenshot saved to: ",filepath