Use og:image meta data for thumbnails

See also:
* https://developers.facebook.com/docs/share/
* https://developers.facebook.com/tools/debug
This commit is contained in:
Keith Mitchell
2012-04-24 14:45:58 -07:00
parent 6fe0af5ce6
commit c12801cd60

View File

@@ -201,6 +201,10 @@ class Scraper:
max_url = None
if self.soup:
og_image = self.soup.find('meta', property='og:image')
if og_image and og_image['content']:
log.debug("Using og:image")
return og_image['content']
thumbnail_spec = self.soup.find('link', rel = 'image_src')
if thumbnail_spec and thumbnail_spec['href']:
log.debug("Using image_src")