zoukankan      html  css  js  c++  java
  • shareTo 网页版分享

    // share --------
    var shareTo = function (dest, shareCode) {
    
        var appKey = "1667889534";  // 东财appkey:"3050999700"
    
        var ralateUid = "2248818320";  // 东财ralateUid: "1801487174"
    
        // 分享的链接;shareCode 追踪分享源
        var url = location.href + "?shareCode=" + shareCode;
    
        var source = "分享宝库";
    
        var sourceUrl = "http://from-my-fundation";
    
        var title = "这文真真值得分享~~";
    
        var pic = "http://beauty-face";
    
        // 与分享平台合成后的链接
        var shareUrl = "";
    
        switch (dest.toLowerCase()) {
            case "sina":  // 新浪微博
                shareUrl = "http://service.weibo.com/share/share.php?url="+ encodeURIComponent(url) +"&appkey=" + appKey + "&title=" + encodeURIComponent(title) + "&ralateUid=" + ralateUid + "&source=" + encodeURIComponent(source) + "&sourceUrl=" + encodeURIComponent(sourceUrl)+ "&pic=" + encodeURIComponent(pic) + "&searchPic=false";
                break;
            case "tencent": // 腾讯微博
                 shareUrl = "http://v.t.qq.com/share/share.php?url=" + encodeURIComponent(url) + "&appkey="+ appKey +"&site=http://www.eastmoney.com&title=" + encodeURIComponent(title) + "&pic=" + encodeURIComponent(pic);
                 break;
            case "qzone":  // qq空间
                shareUrl = "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(source) + "&pics=" + encodeURIComponent(pic) + "&summary=" +encodeURIComponent(title) + "&desc=" +encodeURIComponent(title);
                break;
            case "renren":
                shareUrl = "http://widget.renren.com/dialog/share?resourceUrl=" + encodeURIComponent(url) +'&srcUrl='+ encodeURIComponent(url) +'&images='+ encodeURIComponent(pic) + "&title=" + encodeURIComponent(source)  + "&description=" + encodeURIComponent(title);
                break;
            case "sohu":
                shareUrl = "http://t.sohu.com/third/post.jsp?&appkey="+ appKey +"&url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title) + "&content=utf-8&pic=" + encodeURIComponent(pic); //
                break;
            case "msn":
                shareUrl = "http://profile.live.com/badge/?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title) + "&description=" + encodeURIComponent(title);
                break;
            case "douban":
                shareUrl = "http://www.douban.com/recommend/?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title);
                break;
            case "kaixin":
                shareUrl = "http://www.kaixin001.com/repaste/bshare.php?rtitle=" + encodeURIComponent(title) + "&rurl=" + encodeURIComponent(url) + "&rcontent=" + encodeURIComponent(title);
                break;
            case "eastmoney":  // 东财
                shareUrl = "http://t.eastmoney.com/share.aspx?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title) + "&r=" + Math.random();
                break;
            case "guba": // 东财股吧
                shareUrl = "http://iguba.eastmoney.com/share?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title) + "&r=" + Math.random();
                break;
        }
    
        window.open(shareUrl);
    };
    
    // example: 分享到腾讯微博
    shareTo("tencent", "fromVia");
  • 相关阅读:
    PostgreSQL事务特性之嵌套事务
    __attribute__((format(printf, a, b)))
    N个数依次入栈,出栈顺序有多少种?
    操作系统页面置换算法(opt,lru,fifo,clock)实现
    codeforces Round #320 (Div. 2) C. A Problem about Polyline(数学) D. "Or" Game(暴力,数学)
    基于X86平台的PC机通过网络发送一个int(32位)整数的字节顺序
    c/c++多线程模拟系统资源分配(并通过银行家算法避免死锁产生)
    Windows下使用Dev-C++开发基于pthread.h的多线程程序
    斐波那契的四种求法
    红黑树的插入
  • 原文地址:https://www.cnblogs.com/xiankui/p/3927106.html
Copyright © 2011-2022 走看看