如何使用Ajax获取URL的标题,描述,image_url,如在Facebook上共享链接[关闭]

如何使用Ajax获取URL的标题,描述,image_url,如在Facebook上共享链接[关闭]

问题描述:

I am working on a project where if a user submits a URL, it should grab the title, images, and description from that URL and then give an option to change between images.

When submitted it should post those values.

我正在开发一个项目,如果用户提交了一个URL,它应该抓住标题,图片和描述 从该URL开始,然后选择在图像之间进行更改。 p>

提交时,它应该发布这些值。 p> div>

Facebook, Google+ gets image, title, description from two known ways.

1) Most of the well-know websites gives og tags. It contains title, description, image http://ogp.me/

2) meta tags inside head tag of html will also be published by many sites. You can make use of that also.

For more explanation see the following link.

https://webapps.stackexchange.com/questions/6745/how-does-facebook-publisher-select-the-image-title-and-content-from-a-shared

I advise that you make a PHP page that parses the information and returns the data to you Ajax function. So to summarize, you'll want to google: "PHP Parsing HTML" and "Ajax PHP Retrieve Data".