vipickering / mastr-cntrl

A Micropub Microservice
MIT License
26 stars 2 forks source link

Collaboration on parts of the code? #64

Closed voxpelli closed 5 years ago

voxpelli commented 5 years ago

Copied from https://github.com/paulrobertlloyd/indiekit/issues/1, which is about the same thing 😊

Neat with another node.js project doing these kinds of things!

I've opted for a very modular approach in my endpoint to enable others who want to build similar approaches to not have to reinvent every approach and thus that we can collaborate and improve some shared parts while at the same time innovate and experiment with the ones that sets us apart or that we feel takes the wrong approach.

Here's the list of modules I've splited form my main project: https://github.com/voxpelli/webpage-micropub-to-github#modules-used

My main project is basically just a glue between those three modules.

Maybe we could collaborate on the micropub-express and github-publish? Or is there something that you are doing that is pushing in another direction than I am with those modules? If so, I would be interested in hearing your thoughts and ideas on that!

vipickering commented 5 years ago

Certinaly interested!

I'll have a dig through your code and see what I can spot.

In particular, I expect my webmention stuff might be the differentiator. I also save Webmentions as individual JSON files.

When I build my website it:

  1. Generates a JSON feed of Target/Source pairs that are pending to send a webmention (https://github.com/vipickering/vincentp/blob/master/feeds/indieweb/webmentions.json)
  2. On build pings Mastr Cntrl to check for available webmentions.

The JSON feed is generated against another file (https://github.com/vipickering/vincentp/blob/master/_data/published.yml) Which contains the datetime I last sent webmentions. So I only output to the feed everything that is "pending". Anything else is deemed to be sent. This saves having to store data over what has been sent previously or a complicated parsing method to check for sent mentions.

At site build complete, Netlify webhook pings Mastr Cntrl and it looks at the feed for entries.

If it finds them it will:

  1. get the source/targets and send them to Webmention.io.
  2. Get the published.yml file date and update it to the datetime of the sent webmention, + 1 minute and Post it back in to the Github API.

If it does not find them it does nothing.

voxpelli commented 5 years ago

Sounds like you have achieved quite a few things in your endpoint @vipickering! Looking forward to hear back from you after you had some time to look at my modules 😊

vipickering commented 5 years ago

I'll close this and we can all talk in the other thread https://github.com/paulrobertlloyd/indiekit/issues/1

grantcodes commented 5 years ago

Hey, just dropping a notification in here as I started a new repo for reusable micropub middleware brainstorming at https://github.com/grantcodes/future-micropub-endpoint/ so I'd love your input / help :)