Facebook-share: automatic image detection with og:image - facebook

I would like to know how I detect a image from a webpage.
I want a code that if I want to share something on facebook the image from the page where I am at that time, automatically detect.
example:
<meta property="og:image" content="http://www.geturl.thedoctorofhouse.com/audi_a3_2.jpg" />
What should I do with the og:image content?

Yes, that looks correct - content should contain the url to the image that you want used.
You can check how the page metadata is interpreted by using the linter tool provided by Facebook

Related

facebook api feed picture not showing

I have generated the following url to share the page into facebook,
https://www.facebook.com/dialog/feed?app_id=195106440518444&link=https%3A%2F%2Fwww.capella.edu%2Fcapella-experience%2Fflexpath%2F&picture=https%3A%2F%2Fi.pinimg.com%2Foriginals%2Fdd%2F56%2F37%2Fdd56376f6bb3f69130ec3216a13ec99c.jpg&name=Capella+FlexPath&caption=FlexPath%3A+Your+degree.+Your+pace.&description=With+FlexPath%2C+you+can+still+build+the+career-advancing+skills+and+knowledge+you+need%2C+but+with+a+class+schedule+entirely+controlled+by+you.&redirect_uri=https%3A%2F%2Fwww.capella.edu%2Fcapella-experience%2Fflexpath%2Fflexpath-trial-course%2F&ext=1519158959&hash=AeY6NpBp29iik5NI
While hit on the above link, I couldn't see the picture. And I know the picture attribute is deprecated. Then I have tried to use the other way,
I can achieve the same thing with the help of meta tag,
<meta property="og:image" content="https://static.xx.fbcdn.net/rsrc.php/v3/ye/r/lWB96Z8sFtt.png" />
If I have include this meta tag in my page the image will display.
But I would like to display the picture dynamic also same page I would like to use different image on different shares.
Please provide suggestions If you have a idea.

Opengraph: facebook share image wrong image after change image

I use Opengraph to define the facebook share image.
I upload image APPLE.jpg in my article.
The meta tag is
<meta property="og:image" content="http://example.com/APPLE.jpg" />
Then, I found I uploaded the wrong image.
I edit the article and removed the APPLE.jpg image.
I upload a new image BANANA.jpg
<meta property="og:image" content="http://example.com/BANANA.jpg" />
While I share the article to facebook.
The image is still showing APPLE.jpg image.
How do I settle this?
Facebook keeps your image in cache. So if you have changed your image, but kept the same name, you have two solutions :
Use the Facebook debugger and fecth new scrape information. If the image doesn't change, use the second solution.
Change the name of your image, and Facebook will cache the new image.

Setting blank thumbnail while sharing links on Facebook or Linkedin

One of the problems I face while sharing a link of my blogger post on facebook or linkedin is that the thumbnail shared is my picture (which is the only picture on the page). I would prefer no thumbnail being shared.I tried using
<meta property="og:image" content=""
I.e the content is kept as blank, yet it shows a thumbnail. How do i set it to no picture?
You can't. Facebook/Linkedin will crawl your site and decide on it's own what images to offer the user. The og:image meta tag is just a suggestion and not a directive.
The only way to share without image is for the user to remove it.
Update: there is another way. You could detect (on the server) FB/LinkedIns crawler and serve them HTML that does not contain any images. That way they wouldn't have anything to display (just text). I don't know if that's possible on blogger. And if you go down this path, check FB/LinkedIn's TOS if this is allowed (doing this with google, for instance, will get you banned).

Want a specific image for fb liking an article on site..different images when posting articles on fb

I have a like button that works and that takes the image I have specified through the following parameter and attaches to a user liking the post on there feed.
<meta property="og:image" content="http://www.mysite.org/images/logo_50x50.gif" />
I basically want to use this image only for my users when they like an article, but when posting from a specific article "on my facebook site"..I want to be able to still select the images pulled up from that link. That doesn't happen. All I get right now is what I specified in my og:image parameter.
How would I achieve this?
You can't, you just told Facebook which image to use - it's supported to have multiple og:image tags but i'm not sure if which image to display is deterministic, random, or uses a picker like the system used when you don't specify an image

Getting Facebook Like button to not show any image

I was wondering if it is possible to have the post that the like button shows on the facebook feed not show any image but rather just a link like it used to.
I don't think so, but you can try setting your og:image meta take a blank image:
<meta property="og:image" content="http://www.domains.com/img/spacer.gif" />
The test it here to see if it's being pulled properly: http://developers.facebook.com/tools/lint/