Adding support for Raindrop as a provider#2
Open
magebeans wants to merge 1 commit intoBHSPitMonkey:mainfrom
Open
Adding support for Raindrop as a provider#2magebeans wants to merge 1 commit intoBHSPitMonkey:mainfrom
magebeans wants to merge 1 commit intoBHSPitMonkey:mainfrom
Conversation
BHSPitMonkey
requested changes
Jun 10, 2025
Owner
BHSPitMonkey
left a comment
There was a problem hiding this comment.
This is timely—I'm working on migrating my links to Karakeep and adding support here to match, when I get a few more minutes of spare time. Thanks for the PR! I've added a couple suggestions to consider
Comment on lines
+118
to
+129
| // Route to handle Raindrop token submission from the index page | ||
| app.post("/configure/raindrop", urlencodedParser, (req: Request, res: Response) => { | ||
| const token = req.body.raindropToken; | ||
| if (typeof token === 'string' && token.trim() !== '') { | ||
| raindropProvider.setAccessToken(token.trim()); | ||
| res.redirect("/"); // Redirect back to the index page | ||
| } else { | ||
| // Optional: redirect back with an error message, or just show a simple error | ||
| res.status(400).send("Raindrop.io API token cannot be empty. <a href=\"/\">Go back</a>"); | ||
| } | ||
| }); | ||
|
|
Owner
There was a problem hiding this comment.
It would probably be best to register this route in raindrop.ts instead, just to keep the service's logic separated—though, in this initial version where there's no OAuth handler, why not just forgo the HTML form and this POST handler in favor of just defining an environment variable instead?
| */ | ||
| import fs from "node:fs"; | ||
| import express, { Express, Request, Response } from "express"; | ||
| import express, { Express, Request, Response, urlencoded } from "express"; // Added urlencoded |
Owner
There was a problem hiding this comment.
This comment can probably be left out of the final commit (since it's describing the diff rather than the code)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Took a stab at adding Raindrop support since Pocket's going away. I've moved to Raindrop mostly because it's got iOS-native apps and Safari extensions and Alfred integration, which make it easy to add links/bookmarks to it (same as Pocket before), and it has an actual API, which a lot of other alternatives I looked at didn't. This is very much a quick and dirty implementation; I'm hoping to have proper OAuth2 support when I have a little more time to work on it.