社交网络分析 工具
Social sharing sites like Facebook, Twitter, and Google Plus are essential for people who blog like myself. Why write about something you're passionate about if no one can find the article (purposely or by chance?) People share enough of your posts and you get noticed and get a sweet job at Mozilla...in my case.
对于像我这样写博客的人来说,Facebook,Twitter和Google Plus等社交共享网站至关重要。 如果没人能(有目的地还是偶然地)找不到这篇文章,为什么还要写一些您热衷的东西?人们分享了您足够多的帖子,而您在Mozilla中受到关注并获得一份甜蜜的工作……就我而言。
What I don't like about the social sharing sites are their widgets: they load very slowly, you can't customize how they look, and they allow social sites to track which sites you're viewing. Slow, ugly, and invasive -- yuck. You can, however, create social sharing links of your own, making sure to open the sharing window using some custom JavaScript. Here's how!
我不喜欢社交共享网站的是它们的小部件:它们的加载速度非常慢,您无法自定义外观,并且它们允许社交网站跟踪您正在查看的网站。 缓慢,丑陋且具有侵入性- 但是,您可以创建自己的社交共享链接,并确保使用某些自定义JavaScript打开共享窗口。 这是如何做!
I've separated each major share site into it's own function:
我已经将每个主要共享站点都划分成它自己的功能:
function shareTwitter(url, text) { open('http://twitter.com/share?url=' + url + '&text=' + text, 'tshare', 'height=400,width=550,resizable=1,toolbar=0,menubar=0,status=0,location=0'); } function shareFacebook(url, text, image) { open('http://facebook.com/sharer.php?s=100&p[url]=' + url + '&p[images][0]=' + image + '&p[title]=' + text, 'fbshare', 'height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0'); } function shareGooglePlus(url) { open('https://plus.google.com/share?url=' + url, 'gshare', 'height=270,width=630,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0'); }You can add click listeners or use event delegation to call each function when a share button is clicked. If you want to display the share count for each service, I've got a recipe for getting Twitter and Facebook share counts via JSONP.
click共享按钮时,可以添加click侦听器或使用事件委托来调用每个函数。 如果您想显示每个服务的共享计数,我有一个通过JSONP获取Twitter和Facebook共享计数的方法 。
Using your own custom styles and the functions above, you can create elegant social sharing buttons without using each service's widget. Your site becomes faster, more stylish, and respects your user's privacy. Score!
使用您自己的自定义样式和上述功能,您可以创建优雅的社交共享按钮,而无需使用每个服务的小部件。 您的网站变得更快,更时尚,并且尊重用户的隐私。 得分!
翻译自: https://davidwalsh.name/social-sharing-links
社交网络分析 工具
相关资源:JAVA上百实例源码以及开源项目源代码