// ==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/ajax-hook@2.0.3/dist/ajaxhook.min.js
// @grant none
// @license MIT
// @downloadURL none
// ==/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 = ' 点击获取登陆用户Cookie'
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