Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elpheed support for Gemini protocol? #470

Open
duncan-bayne opened this issue Oct 21, 2022 · 2 comments
Open

Elpheed support for Gemini protocol? #470

duncan-bayne opened this issue Oct 21, 2022 · 2 comments

Comments

@duncan-bayne
Copy link

duncan-bayne commented Oct 21, 2022

Hi :) I've been happily using Elfeed as my feed reader for years, but now that I'm exploring Gemini capsules as well I was thinking of raising a PR to add Gemini support to Elfeed.

Some initial reading suggests this might be non-trivial:

  1. curl doesn't support Gemini (see New protocol: gemini curl/curl#6261), & elfeed seems to prefer (need?) curl on Windows.
  2. How to open Gemini URLs? Tight integration with elpher ( https://thelambdalab.xyz/elpher/ ) seems obvious but is probably wrong. On X I'd suggest using something like xdg-open. But then, what about Windows? Or macOS? Etc.
  3. How to test on Windows? I don't actually have a Windows box at home; probably easiest is a Windows EC2 instance. Either I grant @skeeto access to it, or you just have to take my word that it "works on my machine" ;)

@jtecca do you have any thoughts around these points? I see you were working on Gopher support a while back.

@duncan-bayne
Copy link
Author

duncan-bayne commented Oct 21, 2022

Re. 2, this approach by Xah Lee might work: http://xahlee.info/emacs/emacs/emacs_dired_open_file_in_ext_apps.html.

Could wind up being amusingly circular for some folks; browse the URL, pass through xdg-open, which calls back into Emacs to be handled by Elpher 🤣 So presumably this could be configurable - either call out or invoke elpher-go, or something.

@jtecca
Copy link
Contributor

jtecca commented Dec 6, 2022

Hi @duncan-bayne, it's been a while since I last looked at the elfeed code, but the issues you laid out were what I was thinking of when I was working on the Gopher part of elfeed (which is merged and working, BTW). I had wanted to implement gopher and gemini at the same time, but went with gopher only because it was what I could finish with the time I had available.

The lack of native gemini support in curl was the main reason I only implemented gopher support on my PR.

Elfeed heavily relies on curl as the primary mode of cross-compatibility, otherwise relying on Emacs' url-retrieve. IIRC it's not currently designed to have some sort of context switch on curl/not curl based on the protocol -- it's a setting that defines how all feeds are retrieved when elfeed is invoked. You could potentially hack in some sort of context switch to call something like xdg-open but I think it would be brittle (and a literal hack) without rewriting a lot of the assumptions about how elfeed is designed.

If I had free time to work on this, I'd probably implement this as a separate extension package that requires both elfeed and elpher as requirements. It may be easier to write some glue code to call the elpher API to handle the protocol to grab documents from the feed and then tap in directly to the elfeed DB API to add entries to the database. The big downside to this is if skeeto makes any major changes to the DB API then you'll have breaking changes. Given that there hasn't been much updates to the codebase, you might be okay. I'd then plan to depricate this extension package as soon as gemini support lands in curl.

Good luck! This is something I'd use if you're able to work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants