Skip to content

Instantly share code, notes, and snippets.

@shibafu528
Last active December 22, 2024 06:56
Show Gist options
  • Save shibafu528/530fe8936aa1ccf14e6099a6d3bf3187 to your computer and use it in GitHub Desktop.
Save shibafu528/530fe8936aa1ccf14e6099a6d3bf3187 to your computer and use it in GitHub Desktop.
const token = Deno.env.get("TISSUE_TOKEN");
const title = "Komiflo bookmarks COMIC BAVEL 2025.02";
const input = `
https://komiflo.com/comics/25893
https://komiflo.com/comics/25883
https://komiflo.com/comics/25886
https://komiflo.com/comics/25887
https://komiflo.com/comics/25889
https://komiflo.com/comics/25890
https://komiflo.com/comics/25906
https://komiflo.com/comics/25894
https://komiflo.com/comics/25895
https://komiflo.com/comics/25898
`;
const links = input.split("\n").map(s => s.trim()).filter(s => s);
const createCollectionResponse = await fetch("https://shikorism.net/api/v1/collections", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`,
},
body: JSON.stringify({
title: title,
is_private: false,
})
})
const collection = await createCollectionResponse.json();
console.log(collection);
for (const link of links) {
console.log(`==> ${link}`);
const addItemResponse = await fetch(`https://shikorism.net/api/v1/collections/${collection.id}/items`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`,
},
body: JSON.stringify({
link: link,
})
})
console.log(await addItemResponse.json());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment