When you type a URL into facebook, it automatically comes up with the \"post a link\" feature. With most websites, it automatically loads a selection of images it pulls from som
Due to security restrictions, JavaScript cannot load any page from any server. Facebook actually asks the Facebook servers for information about that page, and the servers in turn query the page to extract the information. You, too, will need a server-side implementation of this.
Aside from that, it's fairly simple: use an HTTP client library for your language of choice to connect to the provided URL, then use an HTML parsing library to extract the title
tag, identify a significant piece of text in the body
tag, and extract the img
tag sources that seem the most appropriate.
Once your server is able to extract information about a page, it's a fairly simple exercise to call it through AJAX.