This application sends random bookmarks from your Karakeep (formerly Hoarder) account to your email, Discord, Mattermost, or RSS feed at scheduled intervals. This is a way to remember and discover all the bookmarks you've saved. Send from a specific list or all bookmarks, daily, weekly, or monthly.
- Sends random bookmarks on a daily, weekly, or monthly schedule
- Supports email, Discord, Mattermost, Telegram, and RSS feed notifications
- Configurable number of bookmarks to send
- Option to select bookmarks from all lists or a specific list
- Option to only send unarchived bookmarks (useful for creating a "to-do list" of active bookmarks)
- Self-host with Docker
To use this application, you'll need an API key from your Karakeep account:
- Log in to your Karakeep account and go to settings
- Click 'Api keys'
- Create a new key and copy it
- This is your
HOARDER_API_KEYfor the application
If you have the hoarder CLI installed, you can validate that your API key is working by using the following command:
hoarder --api-key <your-api-key> --server-addr <your-hoarder-server-url> whoamiSet the HOARDER_SERVER_URL environment variable to point to your server:
HOARDER_SERVER_URL=https://your-hoarder-instance.com
If you want to send bookmarks from a specific list, you'll need to get the list ID. You can retrieve your list IDs using a curl command:
curl -L "<your-hoarder-server-url>/api/v1/lists" \
-H "Accept: application/json" \
-H "Authorization: Bearer <your-api-key>" | jqThis will return a JSON response containing all your lists with their IDs. Copy the ID of the list you want to use and set it as the SPECIFIC_LIST_ID in your .env file.
git clone https://github.com/treyg/hoarder-random-bookmark.git
cd hoarder-random-bookmarkCreate a .env file based on the provided .env.example:
cp .env.example .envEdit the .env file with your configuration:
- Add your Karakeep API key
- Set your Karakeep Server URL
- Choose notification method (email, discord, mattermost, telegram, or rss)
- Set frequency (daily, weekly, monthly)
- Set unarchived to true to ignore archived bookmarks
- Configure your timezone and preferred time for notifications
- Configure notification-specific settings
If you need to change the server port mapping from
8080, you can do that in thedocker-compose.ymlfile.
docker-compose up -dCheck the application status:
docker-compose logs -fVisit http://localhost:8080 to see the application status.
To install dependencies:
bun installTo run in development mode:
bun run --watch src/index.tsTo trigger an immediate send for testing:
curl -X POST http://localhost:8080/send-nowTo test the email functionality with a sample bookmark:
curl http://localhost:8080/test-emailThis will send a test email with a sample bookmark to your configured email recipient.
To access your RSS feed (when configured):
curl http://localhost:8080/rss/feedOr simply open http://localhost:8080/rss/feed in your browser or RSS reader. The feed will update according to your configured schedule (daily, weekly, or monthly).
To test the Discord functionality with a sample bookmark:
curl http://localhost:8080/test-discordTo test the Telegram functionality with a sample bookmark:
curl http://localhost:8080/test-telegramBy default, notifications are sent at 9:00 AM UTC. You can customize both the time and timezone:
# In your .env file
TIMEZONE=America/New_York # Your local timezone
TIME_TO_SEND=09:00 # Time in 24-hour format (HH:MM)
- TIMEZONE: Any valid IANA timezone name (e.g.,
America/New_York,Europe/London,Asia/Tokyo) - TIME_TO_SEND: Time in 24-hour format (HH:MM), such as
09:00for 9 AM or21:30for 9:30 PM
These settings apply to all notification frequencies (daily, weekly, monthly). For example:
- With
NOTIFICATION_FREQUENCY=dailyandTIME_TO_SEND=21:30, you'll receive notifications every day at 9:30 PM - With
NOTIFICATION_FREQUENCY=weeklyandTIME_TO_SEND=18:00, you'll receive notifications every Monday at 6:00 PM
Important Note for Gmail Users: Gmail (and many other email providers) no longer allows less secure apps to access your account using your regular password. You must use an App Password instead:
- Enable 2-factor authentication on your Google account (if not already enabled)
- Go to your Google Account > Security > 2-Step Verification
- Go to https://myaccount.google.com/apppasswords
- Select "App" dropdown and choose "Other (Custom name)"
- Enter a name like "Hoarder Random Bookmark"
- Click "Generate"
- Copy the password that appears
- Use this generated password as your
EMAIL_PASSin the.envfile (not your regular Gmail password) - For
EMAIL_SERVICE, use "gmail"
This is required for security reasons and cannot be bypassed. Similar steps may be required for other email providers like Outlook, Yahoo, etc.
-
Create a Discord Application:
- Go to the Discord Developer Portal
- Click on "New Application" in the top right corner
- Give your application a name (e.g., "Hoarder Random Bookmark") and click "Create"
-
Create a Bot:
- In your application page, click on the "Bot" tab in the left sidebar
- Click "Add Bot" and confirm by clicking "Yes, do it!"
- Under the bot's username, you'll see a section for the token
- Click "Reset Token" and confirm to generate a new token
- Copy this token - this is your
DISCORD_BOT_TOKEN - Make sure to enable the "Message Content Intent" under "Privileged Gateway Intents"
- Under "Bot Permissions", select the following permissions:
- Text Permissions:
- "Send Messages"
- "Embed Links" (needed for formatted bookmark links)
- "Read Message History"
- "View Channels"
- Text Permissions:
- Save your changes
- Add Bot to Your Server:
- Go to the "OAuth2" tab in the left sidebar
- Click on "URL Generator"
- Under "Scopes", select "bot"
- Copy the generated URL at the bottom of the page
- Open this URL in your browser and select the server where you want to add the bot
- Authorize the bot
- Under "Bot Permissions", select the following permissions:
- Text Permissions:
- "Send Messages"
- "Embed Links" (needed for formatted bookmark links)
- "Read Message History"
- "View Channels"
- Text Permissions:
- Save your changes and copy the generated URL at the bottom of the page
- Open this URL in your browser and select the server where you want to add the bot
-
Enable Developer Mode in Discord:
- Open Discord
- Go to User Settings (gear icon near your username)
- Go to "Advanced" in the left sidebar
- Enable "Developer Mode"
-
Get the Channel ID:
- Right-click on the channel where you want to receive bookmark notifications
- Select "Copy ID" from the context menu
- This is your
DISCORD_CHANNEL_IDNote: You can only copy the channel ID if you have Developer Mode enabled. If you don't:
- Right click on the channel
- Select "Copy Link"
- Paste the link into your browser
- Look at the URL: https://discord.com/channels/[SERVER-ID]/[CHANNEL-ID]
Ensure your bot:
- Is added to the server where you want to send messages
- Has permissions to view and send messages in the target channel
- Has the correct intents enabled (MESSAGE CONTENT)
- Has all the required permissions:
- Send Messages
- Embed Links
- Read Message History
- View Channels
- If messages aren't being sent, check if your bot has permission conflicts with channel-specific permissions or role hierarchy issues
Common reasons why the channel field is ignored:
- The webhook integration user does not have permission to post in the target channel.
- The webhook was not created by a system admin.
- The channel name is not correct (should be the channel’s name without the #).
- The webhook is restricted to a specific channel in its Mattermost configuration.
For more information on incoming webhooks, see the Mattermost documentation.
-
Create a Bot:
- Open Telegram and search for "@BotFather"
- Start a conversation and send
/newbot - Follow the prompts to create your bot:
- Choose a name for your bot (e.g., "Karakeep Random Bookmark")
- Choose a username ending in "bot" (e.g., "karakeep_random_bot")
- BotFather will provide you with a bot token - this is your
TELEGRAM_BOT_TOKEN - Save this token somewhere secure
-
Get Your Chat ID:
- Start a conversation with your new bot
- Send any message to the bot (e.g., "/start" or "hello")
- Open your browser and go to:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Replace
<YOUR_BOT_TOKEN>with the actual token from BotFather - In the response, look for the
chatobject and find theidfield - this is yourTELEGRAM_CHAT_ID - The chat ID will be a number (positive for individual chats, negative for groups)
- Search for "@userinfobot" in Telegram
- Start a conversation and send any message
- It will reply with your user ID - this is your TELEGRAM_CHAT_ID
Common Issues:
-
"Unauthorized" Error:
- Check that your bot token is correct
- Make sure you copied the full token from BotFather
-
"Chat not found" Error:
- Verify your chat ID is correct
- Make sure you've sent at least one message to the bot first. Just running
/startdidn't work for me the first time - For group chats (not tested), the bot must be added to the group
-
Bot doesn't respond:
- Ensure you've started a conversation with the bot
- Check that the bot hasn't been blocked
-
Messages not formatted correctly:
- The bot uses Telegram's MarkdownV2 formatting
- Special characters are automatically escaped for proper display
Group Chat Setup (not tested but it should work the same):
- To use with a group chat, add your bot to the group
- Send a message in the group, then use the getUpdates URL to find the group's chat ID (will be negative)
- Use this negative number as your
TELEGRAM_CHAT_ID