General instructions
- Internet should be constantly atleast 1 mbps
- Use chrome and keep the slack bookmarks tab in focus (IMPORTANT or you'll else there can be loss of information) on your current chrome window. Leave the script running on your computer with this tab visible along with another chrome window if you want to work while this runs.
- It will take 10 seconds * number of bookmarks (duration) ex. for 100 bookmarks it will take ~15 minutes (if you're confident about very fast internet check the FAQ)
- Computer should not sleep while the script runs
Running the script
- Launch slack (https://app.slack.com/client/) in chrome, login, select the workspace you want to get the bookmarks from. Select "Later" (new name for bookmarks/ saved items) from the left side menu.
- You will automatically be on the "In Progress" tab within the "Later" page. The script is test for "In Progress", you may need to change it for "Archived"/ "Completed"
- Open the developer console on chrome via cmd + option + j (in mac)
- Paste the script, press enter and let it run for the duration calculated above
- Approximately after the duration go and copy a huge message towards the end, you may need to scroll up. You can also search for "Bookmarked Text" in the console and copy the huge message that shows up. If you come much after the duration, log will be lost. The size could be for example 120 kb for 100 bookmarks.
- Put this test in a test.csv file and then import it with google sheets.
About the script
- It's a quick hack and it may not work reliably. Its been tested and worked well on 30 January, 2024 for 100 bookmarks.
- Use case is to get bookmarks that are in a workspace for which you aren't an admin and can't get the token to export data via api.
- The script only gives text as output. No images or files.
You want make it production ready
- Change all setTimeout's to promises or async/ await
- Handle network latency/ timeouts
- Convert to Clean Code
- Try to not hardcode all the class names in the first line
- Probably don't do this via the browser
- Find a way to export images/ files
FAQ
- The slack webpage dissapeared or became small when I ran the script
- The zoom is set to 5% (0.05) so that all bookmarks are downloaded.
document.body.style.zoom = parseFloat(0.05)
- I got repeating bookmarked/ thread text
- Run the script again or set the setTimeout times to 2x of what they are just now
- I want to run a quick test to see if this works
- Set the zoom to 100% (1) to run a quick test on less than 20 bookmarks. Will take around 10 minutes.
document.body.style.zoom = parseFloat(1)
- My internet is slow and it takes time for bookmarks/ threads to load
- Make below changes, increase further as needed
before_start = 20000;
before_loop = 20000;
- It will take 40 seconds * number of bookmarks (duration). ex. for 100 bookmarks it will take ~70 minutes
- My internet is very fast and reliable (10 mpbs)
before_start = 5000;
before_loop = 2000;
- It will take 3 seconds * number of bookmarks (duration). ex. for 100 bookmarks it will take ~5 minutes