Greasy Fork 还支持 简体中文。

WeMeStrongShare

微密圈快速分享【强制分享】

2022-03-30 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         WeMeStrongShare
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  微密圈快速分享【强制分享】
// @author       PWNINT32
// @match        http://web.weme.link/Community/Index
// @icon         https://www.google.com/s2/favicons?domain=weme.link
// @require      https://unpkg.com/[email protected]/dist/ajaxhook.min.js
// @grant        none
// @license MIT
// ==/UserScript==
function LoadingDebugInfo()//加载调试信息
{
    console.warn("[*] 调试信息:脚本加载成功...");
    console.warn("[*] --------------------------");
    console.warn("[*] 欢迎使用本脚本:\n1.本脚本需要搭配工具使用,用于解析付费\VIP帖子\n   2.欢迎加入讨论圈:8390463,每日更新图包");
    console.warn("[*] --------------------------");
}
function GetJsonCookie()
{
    var CookieJar = document.cookie.split(";");
    var ReturnJson = {};
    CookieJar.forEach((item)=>
                      {
        var Result = item.trim().split("=");
        ReturnJson[Result[0]] = Result[1];
    });
    return ReturnJson;
}
function AddExtraInfo(CommunityUid)//为圈子主页添加额外按钮
{
    var MainBar = document.querySelector("body > div.container.body-content > div.main > div.community > div.right > div.right-bottom > div.community-detail > span.action-button");
    MainBar.innerHTML = '<span id="Extra_Uid">点击获取当前圈子的UID</span> <span id="GetCookie">点击获取登陆用户Cookie</span>'
    var CookieSpan = document.querySelector("#GetCookie");
    var GetUid = document.querySelector("#Extra_Uid");
    GetUid.onclick = ()=>{alert(`当前圈子的UID为:${CommunityUid}`)};
    CookieSpan.onclick = ()=>{
        if(GetJsonCookie()["ASP.NET_SessionId"]!=undefined)
        {
            alert(`您的Cookie为:${GetJsonCookie()["ASP.NET_SessionId"]}`);
        }
        else
        {
            alert("浏览器没有取消HttpOnly属性,无法获取登陆Cookie,请安装Cookie Manager解除HttpOnly限制后重试");
        }
    }
}
function GetFullCommunityPost()//更改请求参数获取单个用户全部帖子链接
{
    ah.proxy({
        onRequest: (config, handler) => {
            handler.next(config);//固定写法
        },
        onError: (err, handler) => {
            handler.next(err)
        },
        onResponse: (response, handler) => {
            handler.next(response)
            Change2ShareButton();//等待网页响应完毕后再进行调用
            if(response.config.url.includes("ShareArticle"))
            {
                var ShortLink = JSON.parse(response.response)["data"]["WxUrl"];//获取分享短链
                CloseShareWindowAndGetShareLink(ShortLink);
                console.log("[*] 短链获取成功,内容为"+ShortLink);
            }
            else if(response.config.url.includes("GetCommunityInfo"))
            {
                var CommUid = pageObj.data.CommunityInfo.community.Id;
                AddExtraInfo(CommUid);
            }
        }
    })
}

function Change2ShareButton()
{
    var Action_ItemClass =  document.getElementsByClassName("action-item");
    var Action_ItemClass_Count = Action_ItemClass.length;
    for(var Index=0;Index<Action_ItemClass_Count;Index++)
    {
        var DataEventNum_Ban = "30";
        var DataEventNum_Share = "5";
        var CurrentButton_Type = Action_ItemClass[Index].getAttribute("data-event");
        if(CurrentButton_Type==DataEventNum_Ban)
        {
            Action_ItemClass[Index].setAttribute("data-event","5");
            Action_ItemClass[Index].textContent="获取分享链接";
        }
    }
}
function CloseShareWindowAndGetShareLink(ShareLinkText)//关闭分享成功弹窗,并获取短链内容
{
    var CloseButton = document.getElementById("btn-close");
    if(CloseButton!=undefined)
    {
        CloseButton.click()
        var SearchBox = document.evaluate('/html/body/nav/div/div[1]/form/input',document).iterateNext();
        SearchBox.value = ShareLinkText;//将短链移入到搜索框中
        SearchBox.select();
        document.execCommand('copy');
        var PostInputBox = document.evaluate('/html/body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/textarea',document).iterateNext();
        PostInputBox.value = "链接已复制到剪贴板中,请直接在软件中粘贴!";

    }
}
LoadingDebugInfo()
GetFullCommunityPost()