Page 1 of 1

social media api

Posted: Mon May 24, 2010 12:09 pm
by gth759k
I'm trying to learn more about how social media api's work. For instance, when you're looking at a news article, sometimes it will have a facebook icon to "share" the article on facebook. If you click on the icon you might get a new popup window and if you look at the url it will be something like:

http://www.facebook.com/sharer.php?u=ht ... volatility

So, I'm assuming this sharer.php script takes the $_GET['u'] value and attaches it to your status update but how does it extract out the title of the article and the body and image, from any source you attach it too. Do all those websites that have the icon have the same xml structure or does the sharer.php script just have to guess? Any help would be appreciated.

Re: social media api

Posted: Mon May 24, 2010 12:46 pm
by markusn00b
I assume they use some heuristic that looks for content, typical of an article format. It is an interesting question, though.

Re: social media api

Posted: Mon May 24, 2010 1:38 pm
by Eran
It's just doing some basic scraping, nothing fancy

Re: social media api

Posted: Mon May 24, 2010 5:16 pm
by Reviresco
Not sure if you're asking how to select the image, title and description to display when the page is shared on Facebook? If so, here are some articles that explain it -- very easy, just add the meta tags to the head of your html page:

http://wiki.developers.facebook.com/ind ... _Meta_Tags

http://opengraphprotocol.org/

Re: social media api

Posted: Mon May 24, 2010 5:33 pm
by gth759k
I noticed on a few other articles I tried, when I clicked the facebook icon and checked the url sometimes it also hat a $_GET['t'] variable corresponding to the title of the page.