Skip to content

Instantly share code, notes, and snippets.

@rcaetano
Last active October 6, 2022 15:36
Show Gist options
  • Save rcaetano/6dcdb285c790e0e393f5f9957863ec77 to your computer and use it in GitHub Desktop.
Save rcaetano/6dcdb285c790e0e393f5f9957863ec77 to your computer and use it in GitHub Desktop.
Akord Vault, Extract Permalinks
{
"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"
}
}
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);
}
})();
@rcaetano
Copy link
Author

rcaetano commented Oct 6, 2022

This script extracts the permaweb links for the files stored in your Akord Vault (v2.akord.com)

Requires:

  • node v16
  • npm/yarn
  • @akord/akord-js

To run:

  1. drop both files into a new folder
  2. run npm install or yarn install
  3. edit the constants at the top of vault-dump.js
  4. run node vault-dump.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment