skeeto / elfeed

An Emacs web feeds client
The Unlicense
1.48k stars 116 forks source link

Elfeed support for gopher protocol? #408

Open jtecca opened 3 years ago

jtecca commented 3 years ago

Hi skeeto,

Many thanks for this package! I find that as I get more and more into the gopher protocol as well as gemini that I'd like to be able to have all of my feeds across all of the protocols I use in elfeed. It seems that relatively recent versions of cURL support the gopher protocol, so I think it would be feasible to add support for elfeed to support gopher feeds as well.

What do you think? I will likely try to work on a PR for this if you are interested.

skeeto commented 3 years ago

I'm interested in supporting this. I've already wanted to follow a couple of Gemini feeds. (I ended up using a Gemini HTTP proxy.) What did you have in mind? I'm thinking you could generalize the solution in #397 to other protocols that won't have HTTP headers in their results buffer.

Note: I'm unconcerned with supporting these protocols through the old url-retrieve method since I consider it merely a last-resort fallback.

jtecca commented 3 years ago

Okay, good to know you're on board for this. I'll take a look at the solution you mentioned.

In my mind there's a couple of things to change: add a check for curl capabilities to see if gopher is supported (in the same fashion that compression is also checked) and then add the ability to determine the type of protocol to be called. For the latter, I've been thinking that parsing the start of the feed URL in some sort of regexp-based pcase would influence how the feeds are parsed. I'm thinking of defaulting to HTTP handling by default in case someone has existing feeds specified as "www.foo.com/bar/atom.xml".

This is going to be a weekend project for me, but if you have any particular ideas of places that I should touch then I'm happy to take any other advice. I'm still mostly going through elfeed-curl.el with the debugger to understand the flow.

jtecca commented 3 years ago

Hi skeeto,

I've put up a PR just to review what I have so far: https://github.com/skeeto/elfeed/pull/410

Locally, I am able to point to a gopher feed file (so far, I am just point to a feed file for my own phlog -- RSS doesn't seem to have caught on in the gophersphere yet) and am able to pull down my posts into elfeed and view them without any issue. I've attached some screenshots here to show what I am seeing.

Screenshot_2021-01-08_10-36-02 Screenshot_2021-01-08_10-36-31

The PR has some more information about what needs to be done before this should get merged, but hopefully this looks like it's on the right track for you.

jtecca commented 3 years ago

Even though elfeed will now support reading RSS files over gopher with #410 (thanks again @skeeto for your update to that), I think there's still a piece to this that is missing: properly handling links to gopher protocols in some sort of a suitable browser.

I have been using the Elpher (https://thelambdalab.xyz/elpher/) package for both Gemini and Gopher so there may be a chance to integrate with that package, but I think a more generic solution should be available as well, such as allowing a user to enter in a handler in a lookup table for an HTTP proxy for any given protocol.

JulianKG commented 2 years ago

what the status of Gemini? I tried add a Gemini link and it didn't work, is it yet to be implemented or is this an issue?

jtecca commented 2 years ago

Hi @JulianKG, gemini support fell off my radar because we'd need to support the gemini protocol by either writing in support to elfeed or using an external library. I'm not sure if @skeeto has feelings about either solution, but I could take a look again if there's interest -- it just won't happen until I have some time on my schedule to dig in.