Skip to content

Instantly share code, notes, and snippets.

@apisandipas
Forked from chrisjlee/drupal-views-share-global-text-field
Last active December 12, 2024 13:26
Show Gist options
  • Save apisandipas/74d396c7853b93f5f861091a2135d527 to your computer and use it in GitHub Desktop.
Save apisandipas/74d396c7853b93f5f861091a2135d527 to your computer and use it in GitHub Desktop.
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

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

Linked In

https://www.linkedin.com/shareArticle?mini=true&url=[URL]&title=[TITLE]

E.g https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.google.com&title=This+is+google+a+search+engine

@Chukstart
Copy link

What about Google+

@BriKKou
Copy link

BriKKou commented Nov 21, 2019

@AmirRezaM75
Copy link

Telegram:
https://telegram.me/share/url?url=<URL>

@austriker27
Copy link

I think LinkedIn has removed their direct sharing URL by the way. I dont see it referenced in their docs and have seem rumors of it being dead on stack overflow.

https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin?context=linkedin/consumer/context

@vetras
Copy link

vetras commented Apr 1, 2020

I agree. I can confirm that at least all other params but URL are ignored on the linked in share url... I was hoping I would not have to setup a full blown JS sdk for this.

@muffaddal
Copy link

Wat about instagram?

@shivam-baghla
Copy link

Wat about instagram?
@muffaddal, officially Instagram doesn't have anything with sharing from web at least.
one long alternative is search "mpg25 Instagram API", that can help you.

@blocknomad
Copy link

LinkedIn has updated its API, here you can see more details: https://stackoverflow.com/questions/33426752/linkedin-share-post-url/61583095#61583095

@Alexandre-cibot
Copy link

Alexandre-cibot commented Aug 31, 2021

Thank you for this list ❤️ Saved me time !

@HoresVonAvalon
Copy link

You are my hero. Thanke you so much.

@HoresVonAvalon
Copy link

Hello is there a link for whatsApp to?

@costik2020
Copy link

Thanks really really useful :)

@antarpreet11
Copy link

Thanks, very helpful!

@dk3775
Copy link

dk3775 commented Mar 29, 2023

Hello is there a link for whatsApp to?

yes here : https://api.whatsapp.com/send?text=[URL]

@divineinfosys
Copy link

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