I\'ve just stumbled upon sharing a text (a hashtag) togeher with a text on Facebook / LinkedIn. Here is hwat I am trying to do (hashtag: #STUFF):
While I am uncertain about the other services, you can customize the share text on LinkedIn using this format (Note that all of the {}
placeholder values should be replaced with URL-encoded values):
<a href="https://www.linkedin.com/shareArticle?mini=true&url={URL to share}&title={article title}&summary={article summary}&source={your app/website name}">Link text</a>
E.g.
<a href="https://www.linkedin.com/shareArticle?mini=true&url=http://developer.linkedin.com&title=LinkedIn%20Developer%20Network&summary=My%20favorite%20developer%20program&source=LinkedIn">Link text</a>
Complete documentation for sharing content can be found here: https://developer.linkedin.com/docs/share-on-linkedin
Using sharer, you can only specify url
, like so...
https://www.facebook.com/sharer.php?u={url}
Source: Facebook Sharer Documentation.
BUT, if you register your app, get an app id, and install the Facebook share dialog plugin, then you have virtually unlimited access to specify sharing...
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
Source: Facebook Dialog Documentation.
So, you cannot really specify any text
when sharing on LinkedIn. You can only set the url
param. But you can set the og:
tags to show title
, image
, etc., as a preview in your share page:
<meta property='og:title' content='Title of the article"/>
<meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
<meta property='og:description' content='Description that will show in the preview"/>
<meta property='og:url' content='//www.example.com/URL of the article" />
Source: LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn.
Verify that you did it right with: the LinkedIn Post Inspector.
BUT, similarly to Facebook, if you register your app, get an appid, etc., you can use this format fully to your heart's content...
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Hello World! This is my first Share on LinkedIn!"
},
"shareMediaCategory": "NONE"
}
Source: Microsoft LinkedIn Documentation: Share on LinkedIn.