php 用于社交书签的 AddThis AddToAny、ShareThis 等开源替代方案

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15074566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:30:52  来源:igfitidea点击:

Open source alternative to AddThis AddToAny, ShareThis etcfor Social Bookmarking

phpjavascripthtmlwebsocial

提问by Sherwood Botsford

Before I attempt to re-invent the wheel, I figured that I'd ask the experts.

在我尝试重新发明轮子之前,我想我会问专家。

I'm looking for a multi-social bookmark button that allows me to allow people to recommend particular pages of my web site to their favorite social network/ page reader/ seach engine.

我正在寻找一个多社交书签按钮,它允许我允许人们向他们最喜欢的社交网络/页面阅读器/搜索引擎推荐我网站的特定页面。

Constraints (and reasons why I don't want to use ShareThis)

约束(以及我不想使用 ShareThis 的原因)

  1. The link posted has to be the actual link, not a shortened link. People's lists get shared. I want the link to show my domain.

  2. The script should be served from my own server. I am suspicious of web pages that call scripts from another domain, and I don't want to do that from my domain.

  3. There should be NO contact between the client and any of the social sites until they click on a social site icon.

  4. Script should be well documented internally at least as source -- compacted uncommented short variable name scripts need not apply.

  5. Script is embedded in a static web page, not a CMS.

  1. 发布的链接必须是实际链接,而不是缩短的链接。人们的名单得到共享。我想要显示我的域的链接。

  2. 该脚本应由我自己的服务器提供。我怀疑从另一个域调用脚本的网页,我不想从我的域中这样做。

  3. 客户和任何社交网站之间不应该有任何联系,直到他们点击社交网站图标。

  4. 脚本应该在内部至少作为源文件被很好地记录下来——不需要应用压缩的未注释的短变量名脚本。

  5. 脚本嵌入在静态网页中,而不是 CMS。



Preliminary research:

初步研究:

Koehl blog had a series about this in 2009, then the topic faded. At that point he recomended iBegin, which subsequently became Share, and ran from a site called Enthropia.com. Checking that site, there is a demo posted that is clearly out of date.

Koehl 博客在 2009 年有一个关于这个的系列,然后这个话题就消失了。那时,他推荐了 iBegin,后来它变成了 Share,并从一个名为 Enthropia.com 的网站运行。检查该网站,有一个演示发布,显然已经过时。

At one point AddToAny would allow hosting on your own server, but they still were using the script to track every user's web usage, claiming a suitably anonymity. Right. No thanks.

AddToAny 一度允许托管在您自己的服务器上,但他们仍然使用该脚本来跟踪每个用户的网络使用情况,并声称是适当的匿名。对。不,谢谢。

Another one, OpenLike has a dead webserver.

另一个,OpenLike 有一个死的网络服务器。

A search on SourceForge has come up empty. (I tried searching for the names like AddThis, AddToAny, Sharethis, followed by searches to stumbleupon, reddit, digg, google plus. Nothing relevant.)

在 SourceForge 上的搜索是空的。(我尝试搜索诸如 AddThis、AddToAny、Sharethis 之类的名称,然后搜索到 stumbleupon、reddit、digg、google plus。没有任何相关性。)

At this point I'm faced with having to read and understand each target site's api so I can write a local script that does the right thing. Not trivial.

在这一点上,我必须阅读和理解每个目标站点的 api,以便我可以编写一个执行正确操作的本地脚本。不平凡。

In many ways the ideal would be: * An array of icons in simlarly size and style * that each opened a web page onto the destination page (eg. FB, G+, StumbleUpon..) * with URL parameters appropriate to that page.

在许多方面,理想的情况是: * 一组大小和样式相似的图标 * 每个图标都在目标页面上打开一个网页(例如 FB、G+、StumbleUpon ..) * 带有适合该页面的 URL 参数。

But I don't think that most of these sites have such a simple interface.

但我不认为这些网站中的大多数都有如此简单的界面。

采纳答案by Sherwood Botsford

Answer is simple. The ideal above works, so it's mostly a matter of finding the right code and icons. The key item in my search was 'share by url'

答案很简单。上面的理想是可行的,因此主要是找到正确的代码和图标的问题。我搜索的关键项目是“通过网址分享”

Example 1

示例 1

This is from another post on this site:

这是来自本网站的另一篇文章:

Facebook, Twitter, and Google +1 buttons using only HTML (No Javascript)

仅使用 HTML(无 Javascript)的 Facebook、Twitter 和 Google +1 按钮

http://www.facebook.com/sharer.php?u=http://example.com
http://twitter.com/share?url=http://example.com&text=Description
https://plusone.google.com/_/+1/confirm?hl=en&url=http://example.com

Example 2

示例 2

See Wordpress share buttons without JS or plugins

查看没有 JS 或插件的 Wordpress 共享按钮

<div class="social-button-container">
<div class="share_top_text">Share this post on:</div>
    <div class="SocialCustomMenu">
    <a class="scmTwitter" href="http://twitter.com/home/?status=<?php the_title();?> - <?php echo wp_get_shortlink();?> via @kenmata "title="Tweet this!">Twitter</a>
    <a class="scmFacebook" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?> - <?php echo wp_get_shortlink();?> "title="Share on Facebook!">Facebook</a>
    <a class="scmGoogleplus" href="https://plus.google.com/share?url=<?php the_permalink();?> -  <?php echo wp_get_shortlink();?> "title="Share on Google +!">Google +</a>
    <a class="scmPinterest" href="http://pinterest.com/pin/create/button/?url=<?php the_permalink();?> - <?php echo wp_get_shortlink();?> "title="Share on Pinterest!">Pinterest</a></a>
</div>
</div>

While these are nominally wordpress they should work with some modification with any web server using php. Or they can easily be converted to use template toolkit

虽然这些名义上是 wordpress,但它们应该与使用 php 的任何 Web 服务器进行一些修改。或者它们可以很容易地转换为使用模板工具包

Example 3:

示例 3:

Less social share linksis another example of very clean looking HTML.

较少的社交分享链接是非常干净的 HTML 的另一个例子。

You miss some functionality with this:

你错过了一些功能:

  • No counters. Of course you could implement counters locally.
  • For Facebook the people don't get to see which of their friends liked it. Not a big motivator for me.
  • At this point finding the codes for each service is an obstacle.
  • 没有柜台。当然,您可以在本地实现计数器。
  • 对于 Facebook,人们无法看到他们的哪些朋友喜欢它。对我来说不是一个很大的动力。
  • 在这一点上,找到每个服务的代码是一个障碍。

Specifics:

规格:

  • If someone has already consolidated a share-by-url list, please feel free to post here. I have NOT verified all of the following.
  • TITLE is the share title. Some services will accept it quoted. Others must be in URL format: e.g. spaces are %20 URL must be fully qualified absolute.
  • 如果有人已经合并了按 url 共享的列表,请随时在此处发布。我尚未验证以下所有内容。
  • TITLE 是共享标题。有些服务会接受它引用。其他必须是 URL 格式:例如空格是 %20 URL 必须是完全限定的绝对值。

blogger

博主

http://www.blogger.com/blog_this.pyra?t=&amp;u={url}&amp;n={title}

digg

掘客

http://digg.com/ submit?phase=2&amp;url={url}&amp;title={title}

diigo

迪戈

http://www.diigo.com/post?url={url}&amp;title={title}

email

电子邮件

mailto:?to=&subject={title}&body={url}%0A{description}

facebook

Facebook

http://www.facebook.com/sharer.php?u={url}&amp;t={title}

gmail

邮箱

https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=&su={title}&body={url}%0A{description}

google bookmark

谷歌书签

http://www.google.com/bookmarks/mark?op=add&bkmk={url}&title={title}

linkedin

链接

http://www.linkedin.com/shareArticle?mini=true&amp;url={url}&amp;title={title}&amp;ro=false&amp;summary={description}&amp;source=

myspace

我的空间

http://www.myspace.com/Modules/PostTo/Pages/?u={url}&amp;t={title}

pinterest

兴趣

http://www.pinterest.com/pin/create/button/?url={url}&amp;media={image}&amp;description={title}

reddit

红迪网

http://reddit.com/submit?url={url}&amp;title={title}

tumblr

微博

http://www.tumblr.com/share/link?url={url}&amp;name={title}&amp;description={description}

twitter

推特

http://twitter.com/home?status={title}%20{url}

ymail

邮箱

http://compose.mail.yahoo.com/?to=&subject={title}&body={url}%0A{description}

回答by Mousey

additions to @Sherwood Botsford's list

添加到@Sherwood Botsford 的列表

flipboard http://share.flipboard.com/flipit/load?v=1.0&url=URL&title=TITLE

翻板 http://share.flipboard.com/flipit/load?v=1.0&url=URL&title=TITLE

tumblr http://www.tumblr.com/share/link?url=URL&name=TITLE&description=TITLE

微博 http://www.tumblr.com/share/link?url=URL&name=TITLE&description=TITLE

blogger http://www.blogger.com/blog_this.pyra?t=&u=URL&n=TITLE

博主 http://www.blogger.com/blog_this.pyra?t=&u=URL&n=TITLE

evernote http://www.evernote.com/clip.action?url=$URL&title=TITLE

印象笔记 http://www.evernote.com/clip.action?url=$URL&title=TITLE

getpocket http://getpocket.com/save?url=$URL&title=TITLE

得到口袋 http://getpocket.com/save?url=$URL&title=TITLE

Edit- lyteshare.jsis a lite javascript could be improved upon to add more services

编辑- lyteshare.js是一个 lite javascript 可以改进以添加更多服务

More sources for more links

更多链接的更多来源

Two very comphrensive lists:

两个非常全面的列表:

ss.js on githubgives this pinterest share - which works for anything never pinned before, no script though pinterest

github 上的 ss.js提供了这个 pinterest 共享——它适用于以前从未固定过的任何东西,虽然 pinterest 没有脚本

https://pinterest.com/pin/create/bookmarklet/?url={url}&media={image}&is_video={is_video}&description={title}

https://pinterest.com/pin/create/bookmarklet/?url={url}&media={image}&is_video={is_video}&description={title}

netvibes custom sharingwith Buffer, Baidu, hootsuite and more

netvibes与 Buffer、百度、hoosuite 等自定义共享

回答by Kernel James

Anyone saw the news that AddThis is using a new form of tracking cookies called Fingerprint Canvas that stays forever?

有人看到 AddThis 正在使用一种称为指纹画布的新形式的跟踪 cookie 的消息吗?

http://www.propublica.org/article/meet-the-online-tracking-device-that-is-virtually-impossible-to-block

http://www.propublica.org/article/meet-the-online-tracking-device-that-is-virtual-impossible-to-block

I think we need some open source alternatives like http://expando.github.io/

我认为我们需要一些开源替代品,比如http://expando.github.io/