Last active
October 6, 2022 15:36
-
-
Save rcaetano/6dcdb285c790e0e393f5f9957863ec77 to your computer and use it in GitHub Desktop.
Akord Vault, Extract Permalinks
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": "vault-dump", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"@akord/akord-js": "^1.4.1" | |
}, | |
"scripts": { | |
"run": "node vault-dump.js", | |
"clean": "rm -rf node_modules yarn-error.log yarn.lock" | |
} | |
} |
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 { Akord } = require("@akord/akord-js"); | |
const USER = "-- v2.akord.com email --"; | |
const PASS = "-- v2.akord.com password --"; | |
const VAULTID = "-- get from v2.akord.com url --"; | |
(async () => { | |
try { | |
const { akord } = await Akord.auth.signIn(USER, PASS); | |
const stacks = await akord.stack.list(VAULTID); | |
const output = stacks.map((s) => ({ | |
id: s.id, | |
permalink: `http://arweave.net/${s.files.at(-1).resourceTx}`, | |
})); | |
console.log(JSON.stringify({ vaultId: VAULTID, stacks: output }, null, 2)); | |
} catch (e) { | |
console.error(e); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script extracts the permaweb links for the files stored in your Akord Vault (v2.akord.com)
Requires:
To run:
npm install
oryarn install
node vault-dump.js