Skip to content

Commit

Permalink
Fix deleting kmails
Browse files Browse the repository at this point in the history
  • Loading branch information
gausie committed Jun 18, 2024
1 parent 6718ec9 commit 0ec7fb2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/excavator-web/etl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ async function getPwd() {

async function deleteKmails(ids: number[]) {
const pwd = await getPwd();
const response = await fetch(
const response = await f(
"https://www.kingdomofloathing.com/messages.php",
{
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: `the_action=delete&pwd=${pwd}&box=Inbox&${ids.map((id) => `sel${id}=on`).join("&")}`,
credentials: "include",
method: "POST",
},
);
Expand Down Expand Up @@ -167,7 +169,8 @@ async function main() {
}
}

await deleteKmails(kmails.map((k) => Number(k.id)));
const deleteSuccess = await deleteKmails(kmails.map((k) => Number(k.id)));
deleteSuccess ? console.log("Deleted kmails") : console.error("Failed to delete kmails");
}
}

Expand Down

0 comments on commit 0ec7fb2

Please sign in to comment.