通過qq空間
、qq聊天
、新浪微博
和微信二維碼分享平台提供的接口
,實現
把網頁中對應的圖片、標題、描述的信息參數用javascript獲取后傳進接口中,實現一鍵分享
。
使用到的接口(測試時需要登錄,網址和圖片必須是公網的,不能是localhost):
1.分享到QQ空間接口:https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=你的網址&sharesource=qzone&title=你的分享標題&pics=你的分享圖片&summary=你的分享描述信息
2.分享給QQ好友接口:http://connect.qq.com/widget/shareqq/index.html?url=你的分享網址&sharesource=qzone&title=你的分享標題&pics=你的分享圖片地址&summary=你的分享描述&desc=你的分享簡述
3.分享到新浪微博接口:http://service.weibo.com/share/share.php?url=你的分享網址&sharesource=weibo&title=你的分享標題&pic=你的分享圖片&appkey=你的key,需要在新浪微博開放平台中申請
網頁分享現在用的很少很少,手機分享到微信、QQ等查看原網址
https://github.com/jjdxmashl/jjdxm_social
本文來自 ITROOKIEIS 的CSDN 博客 ,全文地址請點擊:https://blog.csdn.net/qq_15256443/article/details/80963861?utm_source=copy
QZone:
"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{URL}}&title={{TITLE}}&desc={{DESC}}&summary={{SUMMARY}}&site={{SOURCE}}&pics={{IMAGE}}"
QQ:
"http://connect.qq.com/widget/shareqq/index.html?url={{URL}}&title={{TITLE}}&source={{SOURCE}}&desc={{DESC}}&pics={{IMAGE}}&summary={{SUMMARY}}"