Saved Links: alternatives to open graph for link description
Apparently the bookmarklet used to let a user select a quote from a story and then use the selected text as the link description. This no longer works because (as far as I can tell) we're now only looking at the open graph description.
We should also probably consider falling back to the meta description tag if the open graph tag is not present.
So, in order or priority:
- Use selected text as the link description
- If no text is selected, try open graph, if we find it, use that
- if we don't find an open graph tag, look for a meta description tag
- if found, use that
- if none of those ¯(ツ)/¯
Is the $selection = ' '; supposed to lack a self:? All the other attributes have it:
https://github.com/INN/link-roundups/blob/master/inc/lroundups/browser-bookmark.php#L165-L177
hm...i'm guessing that might be the issue, did you try adding it to see if that makes it work?
gonna give it a shot now. it might be different because that $selection isn't coming via the scraper? haven't looked close enough yet. and still haven't found where the selected value is being passed.
:grimacing: causes a fatal error so that's not it...
it was a good guess
@dryanmedia if you used self: instead of self:: that would cause a fatal error.
You'll also need to update any lines referencing $selection to use self::$selection instead.
Yep still causes fatal error.
Here's the old argo-links code where the selection was passed. there was some kind of vimeo embed thing too. https://github.com/argoproject/argo-links/blob/master/argo-this.php#L378
Then this is where that was set as selection or something else. We're missing something that does this. https://github.com/argoproject/argo-links/blob/master/argo-this.php#L579-L590