Extract information from link, like Facebook wall

前端 未结 2 940
青春惊慌失措
青春惊慌失措 2021-02-11 02:37

I have been developing an application that can publish content like some sort of feed. I want to add the content like a link (like on the facebook wall).

Then i want som

相关标签:
2条回答
  • 2021-02-11 02:54

    AFAIK Facebook does this by using meta tags (Open Graph Protocol). You can study more at: https://developers.facebook.com/docs/opengraph/.

    Basically, you should define a convention if you want to implement is internally.
    Hope this helps.

    0 讨论(0)
  • 2021-02-11 02:58

    I think what the facebook infrastructure does is pulls the content of the page (with an ajax call) and then takes the first paragraph (if it's a web page, description if it's a youtube video, etc.) and it allows the user to pick one of the images on the page as a thumbnail. You can just pick the first image in the markup or design your own kind of logic. Basiclly, I would go about this like designing a temporary caching engine. You get the page markup + images, use them and then discard.

    0 讨论(0)
提交回复
热议问题