[UPDATE] Mar 4 2013
Facebook and LinkedIn share links have been updated and the previous way of doing it no longer works as intended. The facebook sharer.php link has been deprecated last year and I think they are starting to remove functionality to force people to use the New Facebook Feed Dialog (http://developers.facebook.com/docs/reference/dialogs/feed/) – This requires that you create a Facebook app ID – to request it, go to this link. Or visit this article as it provides a step by step guide on how to go about it.
Once you get to the create app page on Facebook, you will need to fill these in:
- Display Name
Just think of what your application name will be – think of a good name as this will appear below the facebook post. - Contact Email
enter your email - App Domains
For each domain where this app resides, you should enter its domain name here. - Select how your app integrates with Facebook:
For link sharing purposes, I selected Website with Facebook Login and entered my website’s URL on the field marked Site URL
And once that is done, you only need to use this link (with the following parameters) to share a page on your website:
https://www.facebook.com/dialog/feed? app_id=458358780877780& link=https://developers.facebook.com/docs/reference/dialogs/& picture=http://fbrell.com/f8.jpg& name=Facebook%20Dialogs& caption=Reference%20Documentation& description=Using%20Dialogs%20to%20interact%20with%20users.& redirect_uri=https://mighty-lowlands-6381.herokuapp.com/
It will then look like the screenshot below once you click on the share link:
If you’ve ever wanted to put simple plain share to facebook, twitter, linkedin, google+ links from your email newsletters or websites without using any javascript, then here’s how you do it.
For twitter,
<a href="http://twitter.com/share?url={URL}&text={TITLE}">Share on Twitter</a>
For facebook,
<a href="http://www.facebook.com/sharer.php?s=100&p[title]={TITLE}&p[summary]={SUMMARY}&p[url]={URL}&p[images][0]={IMAGE URL}">Share on Facebook</a>
For Linkedin,
<a href="http://www.linkedin.com/shareArticle?mini=true&url={URL}&title={TITLE}">Share on Linkedin</a>
[UPDATE] For linkedin, a title AND summary is now recommended:
<a href="http://www.linkedin.com/shareArticle?mini=true&url={URL}&title={TITLE}&summary={SUMMARY}">Share on LinkedIn</a>
For Google+,
<a href="https://plus.google.com/share?url={URL}">Share on Google+</a>
Replace anything within the curly brackets {} with url-encoded urls, titles, summaries, etc. Here’s a useful online url encoder if you want one.