Skip to content

Instantly share code, notes, and snippets.

@shibafu528
Created December 27, 2023 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 links = [
"https://komiflo.com/comics/20888",
"https://komiflo.com/comics/20889",
"https://komiflo.com/comics/20890",
"https://komiflo.com/comics/20891",
"https://komiflo.com/comics/20892",
"https://komiflo.com/comics/20893",
"https://komiflo.com/comics/20894",
"https://komiflo.com/comics/20895",
"https://komiflo.com/comics/20897",
"https://komiflo.com/comics/20900",
"https://komiflo.com/comics/20901",
"https://komiflo.com/comics/20902",
];
const createCollectionResponse = await fetch("https://shikorism.net/api/v1/collections", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`,
},
body: JSON.stringify({
title: "Komiflo bookmarks 快楽天 2024.02",
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