How do you find the “main” picture of a website, given the URL?

后端 未结 4 1946
眼角桃花
眼角桃花 2021-02-05 13:59

Let\'s say you\'re given http://nytimes.com How would you pull out the \"main\" image?

The reason I\'m asking is because Flipboard is able to grab the main image from a

4条回答
  •  眼角桃花
    2021-02-05 14:03

    I don't believe there's a standard method. You could start by looking for an Open Graph Protocol image tag. Facebook uses these to select images for urls posted in status updates and comments.

    
    

    If you're prepared to use a third party, Embedly offer this as a chargeable service.

    Embedly provides a powerful API to convert standard URLs into embedded videos, images, and rich article previews from 218 leading providers.

提交回复
热议问题