Posting to FB, pictures in text


(Justin Gordon) #1

It would be nice if the content were formatted so that sharing to FB would not show the image names, when sharing this post.


Facebook OpenGraph Description with Image Filename
Difficulties with Facebook sharing and opengraph tags? Wrong images, excerpt contains image text
Difficulties with Facebook sharing and opengraph tags? Wrong images, excerpt contains image text
(Travis) #2

Looks like there are some errors in the Facebook Open Graph tags.

https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fforum.talksurf.com%2Ft%2Fmaui-paddleboard-championships-before-molokai-to-oahu-for-2014%2F210%2F2

My forum has the same issue and I hadn’t noticed it until you posted. Looks like the url is being incorrectly constructed when you have CDN support turned on.

<meta content="//cdn.strats.co/user_avatar/forum.strats.co/strats/45/6.png" property="og:image">
<meta content="//cdn.strats.co/user_avatar/forum.strats.co/strats/45/6.png" name="twitter:image">

It might just be that facebook doesn’t like the lack of http/https trick? I’m not quite sure since the url is active and works.


(Jeff Atwood) #3

That’s a valid URL, though, it is just protocol agnostic.


(Régis Hanol) #4

Maybe the issue is the redirection?


(Benjamin Kampmann) #5

Nope. Facebook doesn’t like that type of URL:

Done using their Graph Object Debugger on this very topic.


(nXqd) #7

I met this once, and I think Facebook should take this more seriously. But still, in the mean time we should fix it first xD


#8

Has there been any updates or solutions in the meantime? I’m experiencing this issue on my discourse setup as well, even adding a title attribute to the images manually doesn’t seem to help.


(Sam Saffron) #9

og:description and twitter:description need to go through some sanitisation:

<meta content="Here&#39;s some photo&#39;s of last year&#39;s race. FUN!    More images in the Sugar Ranch Facebook Photo Album.    Pre Race       john-gangini-race-director.jpg2048x1366 233 KB       Finishing       justin-off-board-1.jpg720x480 72.2 KB          justin-off-board-2.jpg720x480 74.7 KB          hogan-kania-1.jpg2048x1366 418 KB          hogan-kania-2.jpg2048x1366 417 KB       Post Race       justin-post-race.jpg720x480 58.8 KB          jerry-bess-justin-gordon.jpg2048x1366 320 KB          joel-comer-rebecca-s..." property="og:description" />
<meta content="Here&#39;s some photo&#39;s of last year&#39;s race. FUN!    More images in the Sugar Ranch Facebook Photo Album.    Pre Race       john-gangini-race-director.jpg2048x1366 233 KB       Finishing       justin-off-board-1.jpg720x480 72.2 KB          justin-off-board-2.jpg720x480 74.7 KB          hogan-kania-1.jpg2048x1366 418 KB          hogan-kania-2.jpg2048x1366 417 KB       Post Race       justin-post-race.jpg720x480 58.8 KB          jerry-bess-justin-gordon.jpg2048x1366 320 KB          joel-comer-rebecca-s..." name="twitter:description" />

(Jeff Atwood) #10

Not sure, since the same problem happens in our internal topic one boxing… The image metadata divs are still pulled in as quotes when they should not be, this should be fixed for our internal one boxing first.


(Sam Saffron) #11

I just spent some time looking at this and internally we have a mess that needs cleaning up.

Open graph uses the “sanitize” gem direct to do “excerpts”, other stuff (like pinning topic and oneboxing) uses ExcerptParser.

ExcerptParser has no mode where it strips tags.
ExcerptParser has no mode where it outputs text.

I am unclear if its supposed to be

og:title="&lt;test" 

VS 

og:title="<test"

We don’t have add og:image for the first image larger than 200x200 in the post

We don’t have og:type set to article and don’t add article:published_time and author which we should.

Additionally we are not set up to do this efficiently as we don’t cache this excerpting information anywhere.

Also, our excerpting algorithm can do better, for example take this:

Here's some photo's of last year's race. FUN!

More images in the Sugar Ranch Facebook Photo Album 

###Pre Race

stuff

If we amend it to take say, keep paragraphs and skip headings we could get:

“Here’s some photo’s of last year’s race. FUN! More images in the Sugar Ranch Facebook Photo Album”

Which reads better than

“Here’s some photo’s of last year’s race. FUN! More images in the Sugar Ranch Facebook Photo Album Pre Race stuff…”

Of course, the perfect “block of html to sane summary” is a fiendish algorithm full complications.

Note, our own oneboxer uses the exact same stuff, so you have this:

^^^ note, facebook is picking the surfing image cause it always wants images larger than 200x200.


(Andy Crichton) #12

Is this relevant to why when i share a post with image to Facebook it formats great in preview with image but when posted to FB the image is stripped? It has been checked and the forum server is not doing the stripping. If this is different issue, apologies for being off topic


#13

I’m also a bit confused as to why Facebook is seemingly completely ignoring images in our topics when shared. I’ve set some og:image tags as recommended in this discussion, which works, but for some reason other large images in the topic aren’t available in the image picker, even when scraping the permalink to a post with an image in it.

We can’t even seem to get as far as having the image selectable in the share preview.


I did a quick test here with a larger image and it seems to work, very confused as removing the og:images I’ve set via ‘Customize -> Text Content -> HTML Head’ doesn’t seem to make any difference.

Images from topics seem to appear very randomly if at all…


(Jeff Atwood) #14

The specific problem referenced in the OP was fixed by @zogstrip a while ago.


(Jeff Atwood) #15