views:

51

answers:

0

Hi,

I want to fetch title and description of any website just like how Facebook Link Share does. I wonder if there are any APIs for this?

It is easy to get the title, but sometimes fetching the description is a trouble. Because, not all websites have description meta tag. I've used Simple HTML Dom Parser with PHP to fetch the title & description.

It's also interesting to see that stackoverflow.com didn't have meta tags in its page source. But, Facebook documentation suggests that the page should include title & description meta tags to show up when sharing a link in Facebook via Facebook Link Share. Though, sharing stackoverflow.com at Facebook shows correct title & description.

Thanks!