关于把文章分享到facebook,google,twtter,whatsapp的总结
2018-03-01 20:35
344 查看
关于把文章分享到facebook,google,twtter,whatsapp的总结在网站的mete标签处还需要添加内容<!-- twitter share--> <meta name="title" content="lopScoop"> <meta name="twitter:site" content="@lopscoopNews"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:url" class="share_url" content="http://hotintoday.com/content?id=${contentInfo.id}"> <meta name="twitter:title" class="share_title" content="${contentInfo.title }"> <meta name="twitter:description" content="${contentInfo.description }"> <meta name="twitter:image" content="${contentInfo.thumbnail}"> <!-- FaceBook share-->以及<!-- google+ share --> <meta property="og:url" class="share_url" content="http://hotintoday.com/content?id=${contentInfo.id}" /> <meta property="og:type" content="article" /> <meta property="og:title" class="share_title" content="${contentInfo.title }" /> <meta property="og:description" content="${contentInfo.description}" /> <meta property="og:image" content="${contentInfo.thumbnail }" /> <meta property="fb:app_id" content="1873127332917427" /> //facebook需要appid获取//分享到facebookfunction fbShare(contentId) { u = document.getElementsByClassName("share_url")[0].content; t = document.getElementsByClassName("share_title")[0].content; if (contentId == "-1") { contentId = $("#sharedContendId").html(); } window.open("http://www.facebook.com/sharer.php?u="+ encodeURIComponent(u) + "&t="+ encodeURIComponent(t), "sharer","toolbar=0,status=0,width=626,height=436");}//分享到googlefunction googleShare(contentId) { u = document.getElementsByClassName("share_url")[0].content; t = document.getElementsByClassName("share_title")[0].content; if (contentId == "-1") { contentId = $("#sharedContendId").html(); } //window.open("https://plus.google.com/share?url="+ encodeURIComponent(u), "sharer","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");}//分享到twtterfunction twitterShare(contentId) { u = document.getElementsByClassName("share_url")[0].content; t = document.getElementsByClassName("share_title")[0].content; if (contentId == "-1") { contentId = $("#sharedContendId").html(); } //window.open("http://twitter.com/home?status="+ encodeURIComponent(u) + " " + encodeURIComponent(t),"sharer", "toolbar=0,status=0,width=626,height=436");}分享到whatsappfunction whatsApp(contentId){ u = document.getElementsByClassName("share_url")[0].content; t = document.getElementsByClassName("share_title")[0].content; if (contentId == "-1") { contentId = $("#sharedContendId").html(); } location="whatsapp://send?text="+ encodeURIComponent(t) + encodeURIComponent("\n\n"+u)+"&via=lopscoop";}
//1 facebook 2 pinterest 3 email 4 twitter 5 tumblr//6 relop 7 reddit 8 stumbleupon 9 google 10 linkedin 11 gettile 复制网址',12 whatsapp页面调用的方法(html)<div class="xq-loginshare"> <a href="javascript:fbShare();" class="xq-facebook">facebook</a> <a href="javascript:googleShare();" class="xq-google">google</a> <a href="javascript:twitterShare();" class="xq-twtter">twtter</a> <a href="javascript:whatsApp();" class="xq-whatsapp" data-action="share/whatsapp/share">whatsApp</a> </div>
//1 facebook 2 pinterest 3 email 4 twitter 5 tumblr//6 relop 7 reddit 8 stumbleupon 9 google 10 linkedin 11 gettile 复制网址',12 whatsapp页面调用的方法(html)<div class="xq-loginshare"> <a href="javascript:fbShare();" class="xq-facebook">facebook</a> <a href="javascript:googleShare();" class="xq-google">google</a> <a href="javascript:twitterShare();" class="xq-twtter">twtter</a> <a href="javascript:whatsApp();" class="xq-whatsapp" data-action="share/whatsapp/share">whatsApp</a> </div>
相关文章推荐
- 关于google文章分享
- 分享D瓜哥最近攒的资料(架构方面)、架构分析与设计、知名网站架构分析:Amazon网站架构学习总结、探索Google App Engine背后的奥秘、Facebook图片存储架构、优酷网架构、YouTube架构
- IOS开发中实现whatsapp和Facebook分享过程的总结
- 转载总结一些关于Google chart api的知识
- 关于google技术的文章连接
- Google上面关于cas的文章
- 关于Logistic Regression & Softmax的文章和书摘总结
- 关于Spring中加载xsd文件出现故障的文章总结
- [分享]介绍一篇关于session的好文章,写的很详细
- 今天看了关于重载与多态的文章,觉得不错,分享下
- 关于内存泄漏总结可能最全的文章
- 一个关于车牌识别的文章,感谢作者的分享
- 关于Google protobuf的总结
- (文章)分享功能 & RSS订阅到Google,Yahoo,qq邮箱的接口源码
- 上次CSDN泄密事件或者合并事件反正关于XMPP方面的几篇文章都没影儿了。。。但在此做个总结,让各位做即时通讯的同学少跳几个坑
- 分享自己最近收集关于注册Windows服务的技术文章
- 关于facebook分享
- 偶尔看到的一篇关于黑客文章,拿出来分享下!
- 关于引用的总结(看后我觉得受益匪浅,很好的文章)
- 首届 Google 暑期大学生博客分享大赛——2010 Android 篇 android关于 Google Map 开发的应用