jehna / mastofeeder

RSS to ActivityPub bridge

Home Page:https://mastofeeder.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP only feeds don't work

EvanKrall opened this issue · comments

Hmm. It seems that the site is http-only, and Mastofeeder only supports https sites for the time being. I'll change the issue's title a bit to reflect the issue better

I'll add a few thoughts about this here for future reference.

The real issue is, that the part of the code that guesses the correct interpretation of the dot-formatted username is getting a bit hairy:

let additionalExtension = ""; // TODO: Refactor, the logic is getting messy

I'm thinking that this part needs a bit of refactoring, preferably some kind of lightweight abstraction/DSL rather than a procedural approach. That approach should IMO support combining multiple choices into different combinations, e.g.

  • An URL can have http/https
  • An URL can end in ``/.rss/`.xml`

These two combinations already result in six different URLs:

So we'd need some kind of way to describe this, e.g.:

const choices = [
  prepend('http', 'https'),
  append('', '.xml', '.rss')
  // ....etc
]

and then some mechanism that produces all combinations of those and checks them until it finds a result