Skip to content

awhite.ca

Cambridge area web developer

Sharing content on social networks without Javascript

Posted byAndrew October 25, 2012November 16, 2016

I’m often asked how add share links without using javascript (for example, in an HTML email or in a PDF). Here are the URLs for the most common ones:

  • Pinterest: http://pinterest.com/pin/create/button/?url={articleUrl}&description={articleTitle}
  • LinkedIn: http://www.linkedin.com/shareArticle?mini=true&url={articleUrl}&title={articleTitle}&summary={articleSummary}&source={articleSource}
  • Facebook: http://www.facebook.com/sharer.php?s=100&p[title]={articleTitle}&p[summary]={articleSummary}&p[url]={articleUrl}
  • Twitter: http://twitter.com/share?text={articleSummary}&url={articleUrl}
  • Google+: https://plus.google.com/share?url={articleUrl}
  • Tumblr: https://www.tumblr.com/share?v=3&u={articleUrl}&t={articleTitle}
  • Mail to: mailto:?subject={articleTitle}&body={articleSummary}%20(full%20article%20at%20{articleUrl})

Replace {articleUrl}, {articleTitle}, and {articleSummary} with the appropriate content for your link. Make sure you url encode the values you’re passing. If you don’t have a text editor that can do that for you, use Eric Meyer’s URL Decoder/Encoder.

Posted byAndrewOctober 25, 2012November 16, 2016Posted inCode SnippetTags: html email, share, social media

Post navigation

Previous Post Previous post:
Resize all images in a folder with imageworsener
Next Post Next post:
Weekly link dump
awhite.ca, Proudly powered by WordPress.