Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions lib/glados.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { GLaDOSCookie, userAgent } from "./env.ts";
import { GLaDOSCheckinStatus, GLaDOSCheckinType } from "./types/glados.type.ts";
const workerFunc = async (cookie: string) => {
import { GLaDOSCookie, userAgent } from "./env.ts";
import { GLaDOSCheckinStatus, GLaDOSCheckinType } from "./types/glados.type.ts";

const checkinUrl = "https://glados.rocks/api/user/checkin",
statusUrl = "https://glados.rocks/api/user/status",
referer = "https://glados.rocks/console/checkin",
origin = "https://glados.rocks",
data = {
token: "glados.network",
};
const checkinUrl = "https://glados.rocks/api/user/checkin",
statusUrl = "https://glados.rocks/api/user/status",
referer = "https://glados.rocks/console/checkin",
origin = "https://glados.rocks",
data = {
token: "glados.network",
};

const checkin = async (cookie: string) => {
const checkin: GLaDOSCheckinType = await fetch(checkinUrl, {
method: "POST",
headers: {
Expand Down Expand Up @@ -38,8 +38,10 @@ const checkin = async (cookie: string) => {
}
};

checkin(GLaDOSCookie);
self.addEventListener("message", (event) => {
workerFunc(event.data.cookie);
});

export {
checkin as GLaDOSCheckin
workerFunc as GLaDOSCheckin
};
20 changes: 11 additions & 9 deletions lib/nodeseek.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { nodeseekCookie, userAgent } from "./env.ts";
import { nodeseekCheckinType } from "./types/nodeseek.type.ts";
const workerFunc = async (cookie: string, random: boolean) => {
import { nodeseekCookie, userAgent } from "./env.ts";
import { nodeseekCheckinType } from "./types/nodeseek.type.ts";

let checkinBaseUrl = "https://www.nodeseek.com/api/attendance";
const boardUrl = "https://www.nodeseek.com/api/attendance/board",
origin = "https://www.nodeseek.com",
referer = "https://www.nodeseek.com/board"
let checkinBaseUrl = "https://www.nodeseek.com/api/attendance";
const boardUrl = "https://www.nodeseek.com/api/attendance/board",
origin = "https://www.nodeseek.com",
referer = "https://www.nodeseek.com/board"

const checkin = async (cookie: string, random: boolean) => {
if (random) checkinBaseUrl += "?ramdom=true";
const checkin: nodeseekCheckinType = await fetch(checkinBaseUrl, {
method: "POST",
Expand All @@ -28,8 +28,10 @@ const checkin = async (cookie: string, random: boolean) => {
else console.log(`Nodeseek签到失败,返回的消息:${checkin.message}`);
}

checkin(nodeseekCookie, false);
self.addEventListener("message", (event) => {
workerFunc(event.data.cookie, event.data.random);
});

export {
checkin as nodeseekCheckin
workerFunc as nodeseekCheckin
}
18 changes: 10 additions & 8 deletions lib/v2free.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { v2freeCookie } from "./env.ts";
import { v2freeCheckinType } from "./types/v2free.type.ts";
const workerFunc = async (cookie: string) => {
import { v2freeCookie } from "./env.ts";
import { v2freeCheckinType } from "./types/v2free.type.ts";

const url = "https://w1.v2free.top",
path = "/user/checkin";
const url = "https://w1.v2free.top",
path = "/user/checkin";

const checkin = async (cookie: string) => {
const checkin: v2freeCheckinType = await fetch(url + path, {
method: "POST",
headers: {
Expand All @@ -13,10 +13,12 @@ const checkin = async (cookie: string) => {
}).then(res => res.json());
if (checkin.msg === "您似乎已经签到过了...") console.log(`v2free提示:${checkin.msg}`);
else console.log(`v2free签到结果:${checkin.msg};总流量:${checkin.traffic};今日已用:${checkin.trafficInfo.todayUsedTraffic};过去已用:${checkin.trafficInfo.lastUsedTraffic};剩余流量:${checkin.trafficInfo.unUsedTraffic}`);
}
};

checkin(v2freeCookie);
self.addEventListener("message", (event) => {
workerFunc(event.data.cookie);
});

export {
checkin as v2freeCheckin
workerFunc as v2freeCheckin
};
30 changes: 24 additions & 6 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
import "./lib/glados.ts";
import "./lib/v2free.ts";
import "./lib/ikuuu.ts";
import "./lib/nodeseek.ts";
import "./lib/rainyun.ts";
import "./lib/laecloud.ts";
import { Worker } from "deno";
import { GLaDOSCheckin } from "./lib/glados.ts";
import { v2freeCheckin } from "./lib/v2free.ts";
import { ikuuuCheckin } from "./lib/ikuuu.ts";
import { nodeseekCheckin } from "./lib/nodeseek.ts";
import { rainyunCheckin } from "./lib/rainyun.ts";
import { laecloudCheckin } from "./lib/laecloud.ts";

const workers = [
new Worker(GLaDOSCheckin, { type: "module" }),
new Worker(v2freeCheckin, { type: "module" }),
new Worker(ikuuuCheckin, { type: "module" }),
new Worker(nodeseekCheckin, { type: "module" }),
new Worker(rainyunCheckin, { type: "module" }),
new Worker(laecloudCheckin, { type: "module" }),
];

workers.forEach(worker => {
worker.postMessage({ cookie: "cookie", random: false });
worker.onerror = (error) => {
console.error(`Error in worker: ${error.message}`);
worker.terminate();
};
});