It sometimes happens that the iNaturalist photo you want to share to a social media platform isn’t the cover photo of the observation. In that case, if iNaturalist were to set the Open Graph meta tags
og:url for individual image pages, then the social media platform would automatically preview the image when the URL for the image page is shared instead of falling back to
og:image for the site. Would you please make that happen?
This is related to my earlier request about Open Graph for searches, and which was implemented. Thanks very much for that! https://forum.inaturalist.org/t/improve-social-media-share-preview-title-description-image/13450
Here is a humorous interaction with an observation that previews badly on Discord because these tags are missing:
Here are my initial thoughts about the content of the tags:
og:urltag should contain the page url: https://www.inaturalist.org/photos/39689854
og:imagetag should contain the image url: https://static.inaturalist.org/photos/39689854/medium.jpg?1558614386 (or whatever size is appropriate - cf. the observation page tags which set it to large.jpg, so maybe that should be used here for consistency)
og:titlefield should summarize what the photo is: Megaptera novaeangliae (Humpback Whale), © Oscar Johnson, some rights reserved (CC BY-NC-ND)
- The og:description should contain the observer’s description.
Interestingly, an Inspect of the page shows the observation description supplied by the observer is embedded in the page, but it is not used in the visible content of the page.
Just to remind you: Dronefly bot is not involved at all in this! The Discord platform itself reads the URL, extracts any meta tags it can find, and generates the preview from those. That’s similar to what happens for shares of non-cover-images to other social platforms like Facebook and Twitter.
For comparison, sharing an observation works fine because appropriate
og:* tags are already filled in. The observation for the photo above, however, sets
og:image to the not particularly funny cover image that best represents the observation for ID purposes, as it ought to: https://www.inaturalist.org/observations/25611506
Inspecting the page shows these
og:* tags are set on the observation:
<meta content="Megaptera novaeangliae (Humpback Whale)" property="og:title"> <meta content="https://static.inaturalist.org/photos/39689848/large.jpg?1558614378" property="og:image"> <meta content="https://www.inaturalist.org/observations/25611506" property="og:url"> <meta content="Megaptera novaeangliae (Humpback Whale) from Monterey Bay, Monterey County, CA, USA on October 13, 2006 at 12:53 PM by Oscar Johnson. One of the coolest experiences I've had with a Humpback. This individual approached our boat, whi..." property="og:description">
Sadly, the preview would miss the funny story about people getting sprayed by whale snot, and following the link would only take you to the photo page. The user would have to click one more time to get to the user’s description, but that’s a whole different issue.