Social Share Links with Custom Icons [closed]

2019-03-07 19:23发布

I'm looking for any solid current information on creating custom share icons for the following.

  • Facebook
  • Twitter
  • Google +
  • LinkedIn
  • Pinterest

All the documentation I keep getting to seems to be about using THEIR social like / share buttons - which most of the time I think are not very appealing. Things like socialite.js help to deal with some of the other issues that arrise when using the "native" like / share buttons (sorry not sure what else to call them), but they're not very pretty to be honest.

Any reference material / tutorials or guidance would be awesome.

Cheers.

10条回答
Luminary・发光体
2楼-- · 2019-03-07 20:14

For Facebook sharing you can simply add this link to any object:

<a href="http://www.facebook.com/sharer.php?u=<url to share>
&t=<title of content>">link or image</a>

For the rest: Sorry, but I cannot help you.

查看更多
戒情不戒烟
3楼-- · 2019-03-07 20:15

A github repo that is regularly updated and retested, with what looks like about ~50 or 60 services listed.

https://github.com/bradvin/social-share-urls

This is much better than the accepted answer. NewsVine, Delicious, Slashdot, Ping.fm, etc., are all non-existent services today. Plus, some important ones are missing, Skype, etc..

查看更多
Ridiculous、
4楼-- · 2019-03-07 20:18

Just a quick update on these links, here's a link for Google+

https://plus.google.com/share?url=[URL]

Now, if you want those links to open in a new window, just add this javascript code after the href's:

onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"

This javascript code works with Twitter, Google+ and Facebook (maybe some other, but I haven't tested any other social networks).

Example for WordPress:

<a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">Here you can add text, image, whatever.</a>
查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-03-07 20:18

In order to customize buttons as well as the share counts from different social networks and url sharing services, you can use a proxy server. The social button server Meddelare does exactly this (FYI, I'm the developer behind Meddelare).

Meddelare: This is an open source and self-hosted alternative to sharing services such as AddThis and ShareThis. Because you run the proxy server yourself, you are also defending your users’ privacy against the social networks’ tracking. Users only opt in to their tracking once they decide to click a share button – never implicitly just because they visited your page.

There are several versions: a standalone server, middleware for your Express.js server and a separate backend for completely custom solutions.

Screenshot of a Meddelare example

See Meddelare's examples for the JSON/JSONP you get from the server plus script usage.

查看更多
登录 后发表回答