A small collection of methods for adding share buttons that don't rely on JavaScript or any authorization stuff.
For all of these samples a new window will pop up separately with a defined height and width. In that window will be the submission form for whichever social network is being used populated with the content specified in the parameter fields.
To use, copy the code listed and update the content in the paramter areas. If you prefer to use an image instead of text, just have the anchor tag wrap an img
tag.
You must encode all the URLs you use within the sharer URL.
Twitter allows you to send a tweet and takes the text of the tweet as its only parameter.
Snippet:
<a href="http://twitter.com/intent/tweet?text=[TWEET_CONTENT_GOES_HERE]" onclick="window.open(this.href, 'twitterwindow','left=20,top=20,width=600,height=300,toolbar=0,resizable=1'); return false;">Tweet this</a>
Facebook allows you to share a webpage and takes a title, summary, url, and image(s) as parameters. This usually performs better if you include open graph meta tags.
Snippet
<a href="http://www.facebook.com/sharer.php?s=100&p[title]=[TITLE_GOES_HERE]&p[summary]=[SUMMARY_GOES_HERE]&p[url]=[URL_GOES_HERE]&p[images[0]=[IMAGE_GOES_HERE]" onclick="window.open(this.href, 'facebookwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Share on Facebook</a>
Meta Tags
<meta property="og:url" content="">
<meta property="og:image" content="">
<meta property="og:title" content="">
<meta property="og:description" content="">
Tumblr takes a URL and title as parameters.
Snippet:
<a href="http://www.tumblr.com/share?s=&v=3&u=[URL_GOES_HERE]&u=[TITLE_GOES_HERE]" onclick="window.open(this.href, 'tumblrwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Share on Tumblr</a>
Google+ just takes a URL as the parameter for the sharer link
Snippet:
<a href="https://plus.google.com/share?url=[URL_GOES_HERE]" onclick="window.open(this.href, 'googlepluswindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Share on Google+</a>
Pinterest let's you pin images or video and takes the media, a URL, media type, and a description as parameters.For the is_video
parameter, select true
or false
.
Snippet:
<a href="http://pinterest.com/pin/create/bookmarklet/?media=[IMAGE_GOES_HERE]&url=[URL_GOES_HERE]&is_video=[true|false]&description=[DESCRIPTION_GOES_HERE]" onclick="window.open(this.href, 'pinterestwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Pin this!</a>
Reddit takes a URL and Title for the post.
Snippet:
<a href="http://www.reddit.com/submit?url=[URL_GOES_HERE]&title=[TITLE_GOES_HERE]" onclick="window.open(this.href, 'redditwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Post to Reddit</a>
Hacker News takes a URL and Title for the post.
Snippet:
<a href="http://news.ycombinator.com/submitlink?u=[URL_GOES_HERE]&t=[TITLE_GOES_HERE]" onclick="window.open(this.href, 'hackernewswindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Submit to Hacker News</a>
Buffer App takes a URL and Title for the post.
Snippet:
<a href="http://bufferapp.com/add?text=[TITLE_GOES_HERE]&url=[URL_GOES_HERE]" onclick="window.open(this.href, 'bufferwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Queue on Buffer</a>
Digg takes a URL and Title for the post.
Snippet:
<a href="http://digg.com/submit?url=[URL_GOES_HERE]&title=[TITLE_GOES_HERE]" onclick="window.open(this.href, 'diggwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Submit to Digg</a>
LinkedIn takes a URL and Title for the post.
Snippet:
<a href="http://www.linkedin.com/shareArticle?url=[URL_GOES_HERE]&title=[TITLE_GOES_HERE]" onclick="window.open(this.href, 'linkedinwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Post on LinkedIn</a>
StumbleUpon takes a URL and Title for the link.
Snippet:
<a href="http://www.stumbleupon.com/submit?url=[URL_GOES_HERE]&title=[TITLE_GOES_HERE]" onclick="window.open(this.href, 'stumbleuponwindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Post on StumbleUpon</a>
Delicious takes a URL and Title for the link, and also takes a "provider" naming the company that provided the link.
Snippet:
<a href="https://delicious.com/save?v=5&provider=[PROVIDER_GOES_HERE]&noui&jump=close&url=[URL_GOES_HERE]&title=[TITLE_GOES_HERE]" onclick="window.open(this.href, 'deliciouswindow','left=20,top=20,width=600,height=700,toolbar=0,resizable=1'); return false;">Save this on Delicious</a>