When a user shares content from my website, often the image appearing in the thumbnail is the logo of the website instead of the image itself.
How can I tell reddit to ignore the logo ?
I searched a lot and found answers on how to specify which image reddit should use with the og image
meta tag, but I can't do that since my website is part UGC, meaning I wouldn't know what is the absolute URL for every image.
For example: reddit not pulling scraping image on link post
EDIT:
This doesn't seem to be working on my end. Does it work on yours ?
<script>
function img_find() {
var imgs = document.getElementsByTagName("img");
var imgSrcs = [];
for (var i = 0; i < imgs.length; i++) {
imgSrcs.push(imgs[i].src);
}
return imgSrcs;
}var result = img_find();
$("meta[property='og:image']").attr("content", result[1]);
</script>
website.com/page/fhj2kdshf4aje3dshfla8sdhfsjd
withfhj2kdshf4aje3dshfla8sdhfsjd
being the image. My issue is that I don't know how to specify themeta
tagog:image
such that it points to the absolute url of the current image :/window.href
gives mewebsite.com/page/
, but how do I get the image name ? – Aceous