开发者

Facebook-like share a link parsing?

How does facebook share a link parsing work? Given a url, i need to extract title, blurb and t开发者_开发知识库humbnail (if any).

Are there any libraries or widgets that already do this? (preferably client side javascript)


You cant do this on client only.

For the reason see: Why cant I load an external resource from jQuery load method? And the accepted answer there gives you the options.

You will have to do it like this:

  1. Create a server script that loads the page. Your javascript code sends a request with the given link to this script.
  2. This script may parse the requested page to get the wanted information (This answer may help you for PHP and this one for java)
  3. Your script may return JSON Data which you can process with javascript in the browser
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜