This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getLatestStableChromeUserAgent() { | |
const d = await axios.get('https://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages') | |
if (d.data) { | |
let splitTemp = d.data.split('Package: google-chrome-stable\nVersion: ') | |
return `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${splitTemp[1].split('\n')[0].split('.')[0]}.0.0.0 Safari/537.36` | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const generateRandomMac = (/* prefix = '' */) => { | |
// https://stackoverflow.com/questions/24621721/how-would-one-generate-a-mac-address-in-javascript | |
// https://en.wikipedia.org/wiki/MAC_address#Ranges_of_group_and_locally_administered_addresses | |
return 'XR:XX:XX:XX:XX:XX'.replace(/X/ig, (x) => { | |
return "0123456789ABCDEF"[Math.floor(Math.random() * 16)] | |
}).replace('R', '26AE'[Math.floor(Math.random() * 4)]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uptimerobot_id = 'your uptimerobot_id' | |
const upstream = 'stats.uptimerobot.com' | |
const upstream_path = '/' + uptimerobot_id | |
const replace_dict = { | |
'$upstream': '$custom_domain', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
/** | |
* Respond to the request | |
* @param {Request} request | |
*/ | |
async function handleRequest(request) { | |
let url = request.url.substr(8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yarn add axios | |
# npm -i axios | |
let fs = require('fs') | |
let axios = require('axios') | |
let config = require('./config.json') | |
async function checkchromeversion() { | |
let system = ['Windows NT 10.0; Win64; x64', 'Windows NT 6.1; Win64; x64'] | |
let data = await axios.get('https://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages') | |
if (data.data) { | |
let v = data.data.split('\n')[1].split(' ')[1].split('-')[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rq = require('request-promise') | |
const url = 'http://ca.muc.edu.cn/zfca/login?service=http%3A%2F%2Fmy.muc.edu.cn%2Fuser%2FsimpleSSOLogin' | |
const ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36' | |
async function run(username,password){ | |
// 登录前要的两个数值 cookie lt | |
let {cookie,lt} = await new_pre_login_value() | |
let ticket_url,ticket,caUserName = false | |
let j = rq.jar() | |
await rq.post({ | |
url: url, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rqtest = (method, url, data, options) => { | |
uatest(options.ua) | |
} | |
let uatest = (ua = false) => { | |
console.log(ua) | |
} | |
rqtest('POST', 'xxx', { | |
type: 111 | |
}, { | |
crypto: 'weapi', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// download hitokoto.json from https://github.com/kokororin/hitokoto | |
$hitokoto = json_decode(file_get_contents('./hitokoto.json'),true); | |
$h = $hitokoto[array_rand($hitokoto)]; | |
$hh = $h['hitokoto']; | |
$count = mb_strlen($hh,'UTF-8'); | |
$height = $count * 27; | |
$width = 30; | |
$line = 1; | |
//换行还是有点bug 不想思考了 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request= require('request'); | |
var fs= require('fs'); | |
let user=['user'] | |
let j = request.jar() | |
let usercookie=[]; | |
for (var ii = 0; ii < user.length; ii++) { | |
let i=ii; | |
let loginurl="https://fujianlogin.safetree.com.cn/LoginHandler.ashx?userName="+user[ii]+"&password=123456&checkcode=&type=login&loginType=1" | |
request({url: loginurl, jar: j}, function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let request = require('request'); | |
let cheerio = require('cheerio'); | |
let fs = require('fs'); | |
let tempurls = []; | |
let headers = { | |
'pragma': 'no-cache', | |
'dnt': '1', | |
'accept-encoding': 'gzip, deflate, br', | |
'upgrade-insecure-requests': '1', | |
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3319.0 Safari/537.36', |