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
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.
- cURL, , - HTML DOM, .
- oEmbed, , HTML:
oEmbed - , URL- . API - (, ), , .
oEmbed , YouTube Flickr.
, , html , "". . http://www.embedify.me, URL- fb- script. , embed.ly oembed , , , fb.
, 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.