Facebook scraper requires protocol (e.g. http) on og:image meta tags.

This commit is contained in:
Dominic Tracey 2017-03-26 19:37:55 -04:00
parent d87c5e2efa
commit 7d5d1a12ad

View file

@ -5,7 +5,7 @@ function getEmbedlyData(url) {
var data = {};
var extractBase = 'http://api.embed.ly/1/extract';
var embedlyKey = getSetting('embedlyKey');
// 200 x 200 is the minimum size accepted by facebook
// 200 x 200 is the minimum size accepted by facebook
var thumbnailWidth = getSetting('thumbnailWidth', 200);
var thumbnailHeight = getSetting('thumbnailHeight', 200);
@ -30,7 +30,7 @@ function getEmbedlyData(url) {
// console.log(result)
if (!!result.data.images && !!result.data.images.length) // there may not always be an image
result.data.thumbnailUrl = result.data.images[0].url.replace("http:", ""); // add thumbnailUrl as its own property and remove "http"
result.data.thumbnailUrl = result.data.images[0].url // add thumbnailUrl as its own property and leave "http" in, Facebook scraper won't accept it as valid otherwise
if (result.data.authors && result.data.authors.length > 0) {
result.data.sourceName = result.data.authors[0].name;