Skip to content

Instantly share code, notes, and snippets.

@chrisjlee
Last active April 23, 2024 04:07
Show Gist options
  • Save chrisjlee/5196139 to your computer and use it in GitHub Desktop.
Save chrisjlee/5196139 to your computer and use it in GitHub Desktop.
share url's for facebook, twitter, pinterest with just get variables
<ul>
<li class="share-text">Share this>/li>
<li class="share-tw"><a href="http://twitter.com/share?text=[title]"><span></span></a></li>
<li class="share-fb"><a href="http://www.facebook.com/sharer.php?u=/node/[nid]&p=[title]"><span></span></a></li>
<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=/node/[nid]&description=[title]"><span></span></a></li>
</ul>

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=<URL>&p[title]=<TITLE>

E.g. http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.google.com%[title]=This+Is%2C+Google+a+search+engine

Pinterest

http://pinterest.com/pin/create/button/?url=<URL>&description=<TITLE>

E.g http://pinterest.com/pin/create/button/?url=https%3A%2F%2Fwww.google.com&description=This+is+google+a+search+engine

@AngosStudio
Copy link

Instagram have something like Facebook Sharer link?!

@usamamashkoor
Copy link

@AngosStudio did you find anything for Instagram share..?!

@luukskeur
Copy link

Mail share
mailto:?subject=[title]&amp;body=[URL]

@OliverJAsh
Copy link

Pinterest doesn't seem to honour the provided description unless you also provide a media.

@lalit121
Copy link

lalit121 commented Dec 16, 2017

example "a class="twitter-share-button" href="https://twitter.com/intent/tweet?url=https://www.example.com&text=Hello"
How to Add Image url in this Twitter Share Button ??
Please Replay me !

@ykoken
Copy link

ykoken commented Jan 31, 2018

instagram ?

@enriquesoto
Copy link

instagram?

@vickymcc
Copy link

talk about instagram

@MBK8303
Copy link

MBK8303 commented Jun 13, 2018

How we can get response in Asp.Net Application from Facebook, LinkedIn and other social media platform when we share content from Asp.Net that content upload successfully or not.

@m-aluya
Copy link

m-aluya commented Aug 28, 2018

@Ahmadkhan12345566
Copy link

Ahmadkhan12345566 commented Feb 24, 2021

Facebook
http://www.facebook.com/sharer.php?u=&p[title]=<TITLE>

E.g. http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.google.com%[title]=This+Is%2C+Google+a+search+engine

http://www.facebook.com/sharer.php?u=myurl.com&p[title]=testtile

url working fine
title not working
This url used to accept Parameters such as title and description, but they are no longer supported and should not be used.

@brandonhill
Copy link

brandonhill commented Jan 12, 2022

@Ahmadkhan12345566 title is sourced from og:title meta, but you can supply custom a text snippet with quote, e.g.:

...sharer.php?u=myurl.com&quote=Lorem%20ipsum

You can see what the title will be using the share debug tool: https://developers.facebook.com/tools/debug/?q=myurl.com

@KiddAu
Copy link

KiddAu commented Apr 23, 2024

For facebook, quote parameter is not working anymore, can use hashtag instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment