I'm trying to link to individual Facebook posts and display the post page's meta data, including an image preview, but looking at the FB post page's source, it has none of the usual meta nor open graph tags.

I found that LinkedIn and Google Plus are able to retrieve meta data when you post a link to a facebook post. See below for a LinkedIn example.

How are they doing it!?

enter image description here

2

There are 2 answers

0
ryd3r On BEST ANSWER

What I wanted to do was get the post page's metadata which wasn't appearing when I requested the url from my server using http.

But what I received was Facebook's error page for "Update your browser"

So I added ...

User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

... to the header. And it worked.

0
folizc On

I'm not insider of LinkedIn or Google so not sure of it. But there're two ways they can do it:

  1. Analysing the structure of facebook post and fetch the picture/title/content of post from url.

  2. Fetch post id of the post (fbid), and use graph api to query the details of the post from facebook.