Skip to content

Instantly share code, notes, and snippets.

@doZennn
Last active January 9, 2025 12:24
Show Gist options
  • Select an option

  • Save doZennn/cc7d2942ab6f743731f38e77a208ba0e to your computer and use it in GitHub Desktop.

Select an option

Save doZennn/cc7d2942ab6f743731f38e77a208ba0e to your computer and use it in GitHub Desktop.
Rename archivebox output folders to site title
Array.from(document.querySelectorAll('#table-bookmarks .title-col > [title]')).map(x => {
const title = x.title.replace(/(\W+)/gi, ' ');
const pathParts = URL.parse(x.href).pathname.split('/');
return `cp -R "${pathParts[pathParts.indexOf('archive') + 1]}" "${title}"`;
}).join(';\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment