Skip to content

Instantly share code, notes, and snippets.

Avatar
🏫
Study at college

huggy makeding

🏫
Study at college
View GitHub Profile
View uptimerobot-cloudflare_worker_proxy.js
const uptimerobot_id = '2333' // your uptimerobot id
const upstream = 'stats.uptimerobot.com'
const upstream_path = '/' + uptimerobot_id
const replace_dict = {
'$upstream': '$custom_domain',
@makeding
makeding / b23.js
Created Feb 19, 2021
b23 cloudflare worker
View b23.js
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)
@makeding
makeding / app.js
Created Nov 12, 2020
check latest chrome version
View app.js
# 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]
@makeding
makeding / muc_login.js
Created Sep 23, 2020
中央民族大学 智慧门户 模拟登录
View muc_login.js
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,
View NeteaseCloudMusicApi_test_ua_function.js
let rqtest = (method, url, data, options) => {
uatest(options.ua)
}
let uatest = (ua = false) => {
console.log(ua)
}
rqtest('POST', 'xxx', {
type: 111
}, {
crypto: 'weapi',
View hitokoto_img.php
<?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 不想思考了
View safetree.js
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 () {
View luogu.js
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',