- 安裝 pnpm: https://pnpm.io/installation
- 安裝 node 18:
pnpm env use -g 18
- 安裝 ba:
pnpm i -g bahamut-automation
- 安裝 firefox (optional):
ba install firefox
- 產生 example config (optional):
ba example
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
如何使用? | |
1. 安裝 Docker Desktop: https://www.docker.com/products/docker-desktop/ | |
2. 看 README.md |
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
name: 自動化 | |
on: | |
schedule: | |
- cron: "0 5,17 * * *" | |
workflow_dispatch: | |
jobs: | |
automation: | |
name: 自動化 |
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
KEYS = [ | |
"KITSUNE_climbingintro_VIDEO_SEEN", | |
"KITSUNE_marathonoutro_VIDEO_SEEN", | |
"KITSUNE_fsOneEighty_COMPLETE", | |
"KITSUNE_SLEEPING_CAT", | |
"KITSUNE_CONSTRUCTION", | |
"KITSUNE_HOT_SPRING", | |
"KITSUNE_rugby_rating", | |
"KITSUNE_pingpong:hard_rating", | |
"KITSUNE_TUT_MOVE", |
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 result = {}; | |
let root = `https://www.cac.edu.tw/CacLink/apply110/110apply_pgSieve_22sd8rga/html_sieve_110swk5m/ColPost/collegeList.htm`; | |
console.log(`Fetching College List...`); | |
let college_list_dom = await fetch(root) | |
.then((r) => r.text()) | |
.then((text) => { | |
return new DOMParser().parseFromString(text, "text/html"); | |
}); |
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
// Factorial | |
function F(n){ | |
let sum = 1; | |
for(let i = 1; i <= n; i++) sum *= i; | |
return sum; | |
} | |
// Permutation | |
function P(a, b) { | |
return (F(a) / F(a-b)); | |
} |
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
function response() { | |
this.body = [ | |
{ | |
"id":10000000, | |
"accountId":"a1234567b", | |
"title":"Package", | |
"body":"Please collect your package.", | |
"clientVersion":50600, | |
"country":"tw", | |
"created":1582410142, |
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
if(!location.href.includes("nytimes")) { | |
alert("Only New York Times"); | |
} | |
else { | |
let win = window.open(); | |
win.document.open(); | |
// Get Title | |
try{ | |
win.document.title = document.getElementsByClassName("e1h9rw200")[0].innerText; | |
win.document.write("<h2>"+document.getElementsByClassName("e1h9rw200")[0].innerText+"</h2>"); |
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
function autoCollector() { | |
var self = this; | |
self.start = () => { | |
self.total = "已經獲得:\n\n"; | |
self.log += "\n-- 日誌紀錄開始 --\n"; | |
self.interval = setInterval( | |
function() { | |
try { | |
document.querySelector(self.settings.target).click(); | |
console.log("成功!"); |