Display the social media preview of another site

88 Views Asked by At

I'm building a site which will preview recipes from a couple of other sites (allrecipes, yummly, etc) to users. How can I show a preview of a linked page (for example https://www.yummly.com/recipe/Baked-Zucchini-Chips-9092209)?

I read this post about using iFrame, but that option doesn't display well. Ideally I'd like to grab the preview that the site specified for their social media preview. Is scraping my only option?

2

There are 2 best solutions below

0
On BEST ANSWER

Found this wonderful little package which does exactly what I need and is not limited to any one recipe site: https://pypi.org/project/opengraph-parse/

1
On

I've done a bit of research. It seems their social media preview is a picture of the item eg. Baked Zucchini Chips.

I'd advise using something called a REST API (A sort of data source).
Then you can style and render the data yourself, rather than relying on an external source.

Here's the APIs for the sources you mentioned (from a quick Google search):