I have a site where users can submit content based on a link. Is there a way to detect the main content of the link and take a teaser? For example, on Digg, all of the entries have a small clip / excerpt from the link. That’s pretty much exactly what I want.
I’m working with Ruby on Rails. I found this question on extracting article excerpts but any tips in the right direction would be helpful.
I found out that Digg uses the Open Graph Protocol (http://ogp.me/) by Facebook.
Ultimately, this was exactly what I was looking for!
The Ruby Gem OpenGraph:
https://github.com/intridea/opengraph
By accessing the metadata tag “description”, I got the description e.g.
Some pages (but not most articles) don’t have the description.