How to create a URL extractor like facebook share

I need to extract data from a url as name, description and any vedios images in a given url as facebook share button

like this: http://www.facebook.com/sharer.php?u=http://www.wired.com&t=Test

considers

+5
source share
5 answers

Embed.ly has a nice api just for this purpose. Their api returns the oEmbed data of the site, if available, otherwise it tries to extract a summary of the page, for example Facebook.

+5
source

- cURL, , - HTML DOM, .

+4

- oEmbed, , HTML:

oEmbed - , URL- . API - (, ), , .

oEmbed , YouTube Flickr.

+2

, , html , "". . http://www.embedify.me, URL- fb- script. , embed.ly oembed , , , fb.

+1

, jQuery + PHP url Facebook: http://www.99points.info/2010/07/facebook-like-extracting-url-data-with-jquery-ajax-php/

Instead of using the HTML DOM parser, it works with simple regular expressions. He is looking for names, descriptions and img tags. Consequently, image extraction does not work very well with many sites that use CSS for images. Facebook also looks first at its own meta tags and then at the classic HTML description tag, but it illustrates the principle well.

0
source

All Articles