Created
December 27, 2023 17:41
-
-
Save shibafu528/530fe8936aa1ccf14e6099a6d3bf3187 to your computer and use it in GitHub Desktop.
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
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