1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

添加微信公众号 推文信息 F12 提取

This commit is contained in:
程序员小墨 2023-06-04 17:05:43 +08:00
parent 2b571c1e17
commit 1293b1af33

View File

@ -0,0 +1,62 @@
// 微信公众号 推文信息 F12 提取
let a = {
// 作者信息
appuin: window.appuin, // "MzI0NzU1Mjk3NQ=="
biz: window.biz, // "MzI0NzU1Mjk3NQ=="
sn: window.sn, // "af570aa31c5634f769991fa19f6ca648"
source_appid: window.source_appid, // 公众号appid "wx7fc1f687612899fd"
user_name: window.user_name, // "gh_12ec9e62ced0"
author: window.author, // "大学生记者团"
nickname: window.nickname, // "武汉马拉松"
// 文章信息
appmsgid: window.appmsgid, // "2247505784"
create_time: create_time, // 1681811767
ct: ct, // "1681811767"
// 封面图
msg_cdn_url: window.msg_cdn_url, // 1:1 图片
cdn_url_1_1: window.cdn_url_1_1, // 1:1 图片 "https://mmbiz.qpic.cn/mmbiz_jpg/lOW8OhxyoMvvLKyJkpiaLO0r52s9S5sRcLHBrBpkdnQiconATNtX32aT7qZx0dcNKicazP0ACGmrc28cgAWYeRorQ/0?wx_fmt=jpeg"
cdn_url_235_1: window.cdn_url_235_1, // 2.35:1 图片 "https://mmbiz.qpic.cn/mmbiz_jpg/lOW8OhxyoMvvLKyJkpiaLO0r52s9S5sRcZ27ZxUxibUicxjtncg5xf4GpBBRY1NiaeyfkBRJ2AU5ToYsUH8icTcb2ew/0?wx_fmt=jpeg"
// 文章链接
msg_link: window.msg_link.replace(/&/g, "&"),
// 文章标题
msg_title: window.msg_title,
ori_head_img_url: window.ori_head_img_url, // 公众号头像 http://wx.qlogo.cn/mmhead/Q3auHgzwzM6WjyiakY6Qe7rC10f7R2MNoEkt1Caer3wZYyIkAy4jZicw/132
round_head_img: window.ori_head_img_url, // 公众号头像(圆)
weEmoji: window.weEmoji,
videoPageInfos: window.videoPageInfos,
voiceList: window.voiceList,
}
// 微信公众号文章中提取出的有用函数
var getQuery = function (name, url) {
//参数变量名url为空则表从当前页面的url中取
var u = arguments[1] || window.location.search,
reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"),
r = u.substr(u.indexOf("\?") + 1).match(reg);
return r != null ? r[2] : "";
};
window.getQueryFromURL = function (url) {
url = url || 'http://qq.com/s?a=b#rd';
// 做一层保护保证URL是合法的
var tmp = url.split('?')
, query = (tmp[1] || "").split('#')[0].split('&')
, params = {};
for (var i = 0; i < query.length; i++) {
var arg = query[i].split('=');
params[arg[0]] = arg[1];
}
if (params['pass_ticket']) {
params['pass_ticket'] = encodeURIComponent(params['pass_ticket'].html(false).html(false).replace(/\s/g, "+"));
}
return params;
};