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:
- Create a server script that loads the page. Your javascript code sends a request with the given link to this script.
- This script may parse the requested page to get the wanted information (This answer may help you for PHP and this one for java)
- Your script may return JSON Data which you can process with javascript in the browser
精彩评论