New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook: publish should set "link" field when post ends in a link #474

Closed
kylewm opened this Issue Sep 15, 2015 · 18 comments

Comments

Projects
None yet
4 participants
@kylewm
Collaborator

kylewm commented Sep 15, 2015

When posting a short note to Facebook that contains (ends with?) a URL, sending the "link" field will show a nice link preview on the published post.

I haven't figured out quite the right heuristic for inclusion yet (Shades of #51?), but I definitely want a preview if it's a link to youtube, flickr, twitter, instagram, imgur, medium, etc. I definitely don't want a preview if it's a link to my own domain.

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Sep 15, 2015

Owner

ooh nice find! many of us had wondered why publishing via the FB api didn't get that preview.

and use cases will indeed be interesting to figure out. eg i often do want a preview for links to my own site since they usually have a big picture that's nice as eye candy in fb.

Owner

snarfed commented Sep 15, 2015

ooh nice find! many of us had wondered why publishing via the FB api didn't get that preview.

and use cases will indeed be interesting to figure out. eg i often do want a preview for links to my own site since they usually have a big picture that's nice as eye candy in fb.

@kylewm

This comment has been minimized.

Show comment
Hide comment
@kylewm

kylewm Sep 17, 2015

Collaborator

surprisingly non-trivial! I think I need to pull links out either in or before publish.preprocess_activity (because html2text converts <a href="1">2</a> to 2).

Collaborator

kylewm commented Sep 17, 2015

surprisingly non-trivial! I think I need to pull links out either in or before publish.preprocess_activity (because html2text converts <a href="1">2</a> to 2).

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Sep 17, 2015

Owner

oh boy, yeah.

i hate to do it, but this may complicate it even more: the original post link itself is also a candidate. for example, my own use case is that i tell bridgy to omit the original post link, but i often do want to put it in in the link field so it gets the preview treatment (at least for articles).

...having said that, i wouldn't use this personally - i still posse manually - so take it with a grain of salt.

Owner

snarfed commented Sep 17, 2015

oh boy, yeah.

i hate to do it, but this may complicate it even more: the original post link itself is also a candidate. for example, my own use case is that i tell bridgy to omit the original post link, but i often do want to put it in in the link field so it gets the preview treatment (at least for articles).

...having said that, i wouldn't use this personally - i still posse manually - so take it with a grain of salt.

@kylewm

This comment has been minimized.

Show comment
Hide comment
@kylewm

kylewm Sep 17, 2015

Collaborator

Considering that Bridgy includes the full text of the article, are you sure you'd want a preview link too?

Collaborator

kylewm commented Sep 17, 2015

Considering that Bridgy includes the full text of the article, are you sure you'd want a preview link too?

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Sep 17, 2015

Owner

good point! technically we actually prefer summary before content, so full text may be common but isn't guaranteed.

...however i don't actually use bridgy publish for original posts, so i'm going to shut up up now. :P

Owner

snarfed commented Sep 17, 2015

good point! technically we actually prefer summary before content, so full text may be common but isn't guaranteed.

...however i don't actually use bridgy publish for original posts, so i'm going to shut up up now. :P

@kylewm

This comment has been minimized.

Show comment
Hide comment
@kylewm

kylewm Sep 17, 2015

Collaborator

lol, don't shut up, that's helpful! I'm honestly not sure if anyone POSSEs full articles to Facebook...

Collaborator

kylewm commented Sep 17, 2015

lol, don't shut up, that's helpful! I'm honestly not sure if anyone POSSEs full articles to Facebook...

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Sep 17, 2015

Owner

@tantek maybe?

people have also discussed using facebook notes (e.g. #429), but the API doesn't support them.

Owner

snarfed commented Sep 17, 2015

@tantek maybe?

people have also discussed using facebook notes (e.g. #429), but the API doesn't support them.

@kylewm

This comment has been minimized.

Show comment
Hide comment
@kylewm

kylewm Sep 17, 2015

Collaborator

answer from IRC -- he does, occasionally. example: https://www.facebook.com/tantek.celik/posts/10101774253488583

Collaborator

kylewm commented Sep 17, 2015

answer from IRC -- he does, occasionally. example: https://www.facebook.com/tantek.celik/posts/10101774253488583

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Sep 17, 2015

Owner

is this the same as #411? or just overlapping?

Owner

snarfed commented Sep 17, 2015

is this the same as #411? or just overlapping?

@kylewm

This comment has been minimized.

Show comment
Hide comment
@kylewm

kylewm Sep 17, 2015

Collaborator

Argh, yep duplicate. I swear I searched for facebook link before creating a new issue!

Collaborator

kylewm commented Sep 17, 2015

Argh, yep duplicate. I swear I searched for facebook link before creating a new issue!

@kylewm

This comment has been minimized.

Show comment
Hide comment
@kylewm

kylewm Sep 18, 2015

Collaborator

So interesting thing from @jeena's issue (aside for how terribly short my memory is) is we were talking about using mf2 to mark up the link element. To be clear, I'm now thinking it'll be more useful to look for URLs in the content field, rather than requiring explicit markup.

We've come up with a few different possible cases:

  1. note that is basically plain-text with no links
  2. note with a URL in it somewhere
  3. article with a p-summary
  4. article with a u-featured photo
  5. article with no summary and no photos

I think I can boil it down to just two cases for our purposes:

  1. note -- use the first URL in the text content as the link preview. if not bridgy_omit_link, include (Originally published at ...) in the message.
  2. article -- if not bridgy_omit_link, use the article's URL as the link preview, do not include (Originally published at ...) in the message.

Thoughts?

(note this would've published Tantek's http://tantek.com/2015/190/b1/blinking-fever article differently than he did, including the preview link, which in that particular case would've been a little bit of a spoiler)

Collaborator

kylewm commented Sep 18, 2015

So interesting thing from @jeena's issue (aside for how terribly short my memory is) is we were talking about using mf2 to mark up the link element. To be clear, I'm now thinking it'll be more useful to look for URLs in the content field, rather than requiring explicit markup.

We've come up with a few different possible cases:

  1. note that is basically plain-text with no links
  2. note with a URL in it somewhere
  3. article with a p-summary
  4. article with a u-featured photo
  5. article with no summary and no photos

I think I can boil it down to just two cases for our purposes:

  1. note -- use the first URL in the text content as the link preview. if not bridgy_omit_link, include (Originally published at ...) in the message.
  2. article -- if not bridgy_omit_link, use the article's URL as the link preview, do not include (Originally published at ...) in the message.

Thoughts?

(note this would've published Tantek's http://tantek.com/2015/190/b1/blinking-fever article differently than he did, including the preview link, which in that particular case would've been a little bit of a spoiler)

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Sep 18, 2015

Owner

thanks! those two final cases make sense to me.

normally i'd say "let's look at 3-5 existing attempts and see if this does what their authors would want"...but it seems like this one in particular is going to be pretty subjective and vary widely, so we won't satisfy everyone without more user facing option(s), which i'd probably vote no on. so, i say 👍 :shipit:!

Owner

snarfed commented Sep 18, 2015

thanks! those two final cases make sense to me.

normally i'd say "let's look at 3-5 existing attempts and see if this does what their authors would want"...but it seems like this one in particular is going to be pretty subjective and vary widely, so we won't satisfy everyone without more user facing option(s), which i'd probably vote no on. so, i say 👍 :shipit:!

@snarfed snarfed added the publish label Sep 18, 2015

@snarfed snarfed added the now label Sep 26, 2015

@snarfed snarfed removed the now label Oct 10, 2015

@tantek

This comment has been minimized.

Show comment
Hide comment
@tantek

tantek Nov 18, 2015

Contributor

Alright this is non-trivial for sure - thanks for the above analysis. Here's a "simple" attempt (feel free to poke holes) that vaguely follows what I think are expectations from this thread, and from existing FB behavior.

  1. If the original is an "article" (you know, via that algorithm we have :) then use the original article link itself (@snarfed's suggestion somewhere above).
    (Note: this would have actually worked for http://tantek.com/2015/190/b1/blinking-fever because I deliberately POSSEd the article BEFORE I added the image to it - being paranoid about exactly that spoiler happening).
  2. If it's a "photo", then no need for separate link-preview anything. Do nothing. Users expect the photo to be enough.
  3. Otherwise (it's likely a note or note-like), use the first URL in the text contents being published as / for the link-preview. This is the "existing FB behavior" if you were to manually post a note to FB (also this is what seems to happen with Twitter->FB cross-posts), so this should be predictable, consistent, expected, and not surprising to users.
Contributor

tantek commented Nov 18, 2015

Alright this is non-trivial for sure - thanks for the above analysis. Here's a "simple" attempt (feel free to poke holes) that vaguely follows what I think are expectations from this thread, and from existing FB behavior.

  1. If the original is an "article" (you know, via that algorithm we have :) then use the original article link itself (@snarfed's suggestion somewhere above).
    (Note: this would have actually worked for http://tantek.com/2015/190/b1/blinking-fever because I deliberately POSSEd the article BEFORE I added the image to it - being paranoid about exactly that spoiler happening).
  2. If it's a "photo", then no need for separate link-preview anything. Do nothing. Users expect the photo to be enough.
  3. Otherwise (it's likely a note or note-like), use the first URL in the text contents being published as / for the link-preview. This is the "existing FB behavior" if you were to manually post a note to FB (also this is what seems to happen with Twitter->FB cross-posts), so this should be predictable, consistent, expected, and not surprising to users.
@kylewm

This comment has been minimized.

Show comment
Hide comment
@kylewm

kylewm Nov 18, 2015

Collaborator

This is almost word for word exactly what Red Wind does

https://github.com/kylewm/redwind/blob/f24f2ce577ceef081d890daefd4317c84dadee9b/redwind/plugins/facebook.py#L272

so you know I agree.

Collaborator

kylewm commented Nov 18, 2015

This is almost word for word exactly what Red Wind does

https://github.com/kylewm/redwind/blob/f24f2ce577ceef081d890daefd4317c84dadee9b/redwind/plugins/facebook.py#L272

so you know I agree.

@martymcguire

This comment has been minimized.

Show comment
Hide comment
@martymcguire

martymcguire Apr 19, 2017

I have a (probably weird) case where I want to make a short "teaser" post on FB that links back to the post on my site.

The basics are:

And I would like that link to become the link preview on the FB post.

This works with Twitter using p-bridgy-twitter-content, so that is how I POSSE to Twitter. However, with p-bridgy-facebook-content, FB doesn't pick up the link as a preview.

FWIW, I'd be okay if there was a way to make special markup inside p-bridgy-facebook-content to make this work. :}

martymcguire commented Apr 19, 2017

I have a (probably weird) case where I want to make a short "teaser" post on FB that links back to the post on my site.

The basics are:

And I would like that link to become the link preview on the FB post.

This works with Twitter using p-bridgy-twitter-content, so that is how I POSSE to Twitter. However, with p-bridgy-facebook-content, FB doesn't pick up the link as a preview.

FWIW, I'd be okay if there was a way to make special markup inside p-bridgy-facebook-content to make this work. :}

@snarfed snarfed added the now label Apr 19, 2017

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Apr 19, 2017

Owner

thanks @martymcguire! yup, that's definitely the feature request here.

Owner

snarfed commented Apr 19, 2017

thanks @martymcguire! yup, that's definitely the feature request here.

@snarfed snarfed removed the now label Jul 19, 2017

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Sep 7, 2017

Owner

API support looks pretty straightforward, just include the link field in the POST to me/feed.

https://developers.facebook.com/docs/graph-api/reference/v2.10/user/feed#pubfields

Owner

snarfed commented Sep 7, 2017

API support looks pretty straightforward, just include the link field in the POST to me/feed.

https://developers.facebook.com/docs/graph-api/reference/v2.10/user/feed#pubfields

@snarfed snarfed added the now label Sep 7, 2017

@snarfed

This comment has been minimized.

Show comment
Hide comment
@snarfed

snarfed Apr 26, 2018

Owner

bridgy publish for facebook will disappear soon (#817), so I'm closing open issues for it. sad. feel free to holler if you disagree.

Owner

snarfed commented Apr 26, 2018

bridgy publish for facebook will disappear soon (#817), so I'm closing open issues for it. sad. feel free to holler if you disagree.

@snarfed snarfed closed this Apr 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment