您的位置:首页 > 其它

微博分享网页 简单

2017-05-27 11:07 169 查看
首先在官网上注册个appkey然后再进行下面的步骤就行了,下面的AppKey不可随意使用,否则后果自负;
function postToSina(title,pic,site)
{
var param = {
url:site,
type:'5',
count:'',
appkey:'4177348326',
title:encodeURI(title+""),
pic:pic,
ralateUid:'',
language:'zh_cn',
rnd:new Date().valueOf()
}
var temp = [];
var s = window.screen;
for( var p in param ){
temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
}
var url = "http://service.weibo.com/share/share.php?"+temp.join("&");
window.open(url,"_blank",['toolbar=0,status=0,resizable=1,width=600,height=500,left=',(s.width-440)/2,',top=',(s.height-430)/2].join(''))
}

function postToQQ(title,pic,site){
    var p = {
      url:site,
      showcount:'0',/*鏄惁鏄剧ず鍒嗕韩鎬绘暟,鏄剧ず锛�'1'锛屼笉鏄剧ず锛�'0' */
      desc:title+"  ",/*榛樿鍒嗕韩鐞嗙敱(鍙€�) 鏉ヨ嚜www.iliangcang.com*/
      summary:'',/*鍒嗕韩鎽樿(鍙€�)*/
      title:'',/*鍒嗕韩鏍囬(鍙€�)*/
      site:encodeURI('dasf'),/*鍒嗕韩鏉ユ簮 濡傦細鑵捐缃�(鍙€�)*/
      pics:pic, /*鍒嗕韩鍥剧墖鐨勮矾寰�(鍙€�)*/
      style:'203',
      width:98,
      height:22,
      otype:'share'
    };
     var s = window.screen;
    var param = [];
    for(var i in p){
      param.push(i + '=' + encodeURIComponent(p[i]||''));
    }
    
    var url = "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?"+param.join("&");
    window.open(url,"_blank",['toolbar=0,status=0,resizable=1,width=600,height=500,left=',(s.width-440)/2,',top=',(s.height-430)/2].join(''));
    jQuery('#postToWin').remove();removeDivLayer();
}

function postToDouban(title,pic,site)
{
console.log("aa");
var d=document,
e=encodeURIComponent,
s1=window.getSelection,
s2=d.getSelection,
s3=d.selection,
s=s1?s1():s2?s2():s3?s3.createRange().text:'',
sre = window.screen,
r='http://www.douban.com/recommend/?url='+e(site)+'&title='+e(title+"")+'&sel='+e(s)+'&v=1',
x=function(){
if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330,left='+(sre.width-440)/2+',top='+(sre.height-430)/2))location.href=r+'&r=1'
};
if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}
}


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: