Ever wondered how some links on Facebook are shown with an image and a brief paragraph? I dug deeper to understand what Facebook was doing behind the scenes to visualize the link.
To my surprise, there was something called as "Open Graph Protocol" that defined a set of rules for telling Facebook, how your shared contents should be displayed on it.
For e.g. we can add the following meta-tags in any web page and Facebook would parse these tags when you post the link to this page.
<meta property=”og:title” content=” “/>
<meta property=”og:type” content=””/>
<meta property=”og:url” content=””/>
<meta property=”og:image” content=””/>
<meta property=”fb:admins” content=””/>
<meta property=”og:site_name” content=””/>
<meta property=”og:description” content=””/>
To my surprise, there was something called as "Open Graph Protocol" that defined a set of rules for telling Facebook, how your shared contents should be displayed on it.
For e.g. we can add the following meta-tags in any web page and Facebook would parse these tags when you post the link to this page.
More information can be found at this link - http://www.optimizesmart.com/how-to-use-open-graph-protocol/
No comments:
Post a Comment