scripting / drummerRFC

A place to post RFCs for people who use and develop in Drummer.
MIT License
11 stars 0 forks source link

Posting to drummer.scripting.com from outside Drummer #17

Open scripting opened 2 years ago

scripting commented 2 years ago

My friend @emk wants to post to Drummer from outside Drummer. Yes, this is possible. But rather than playing 20 questions about what he's trying to do, I invite him to post a short comment here outlining the purpose of this project.

To get started, Drummer is running daveappserver, a package I developed as a successor to nodeStorage, which was getting cluttered with lots of extras, and was hard to maintain as a result.

Eric, that's the software your app will be talking to.

There are two calls that post files to the server.

publishFile is the one that Drummer users when the user is editing a file interactively and writeWholeFile is the back end of the file.writeWholeFile verb.

The oAuth values you need can be gotten by logging on to Drummer interactively and copying them from localStorage values, I think it'll be obvious what they are when you look. Without those values you won't be able to post.

That's pretty much the whole thing.

scripting commented 2 years ago

@emk -- please let me know what you're contemplating here. Drummer is hardly the best place to upload OPML files, its sole advantage is that it's the place Drummer stores them. I don't generally upload random OPML files there, preferring S3 or GitHub, because they don't affect the performance of my server, which is believe me a very lower powered server.

Also because we may be working cross-purposes. I have a better picture of the lay of the land outside of LogSeq, which is where I need help. The goal is to get the content of the Journals folder accessible to code running in Drummer. But (and this is a key point) have to be in Drummer's space for it to be easily accessible to a script running in Drummer.

emk commented 2 years ago

Thank you for the information!

My use case here was that I had a bunch of outlines LogSeq, and I wanted to export some of those outlines into Web Drummer (since I can't run Electric Drummer yet). That way, I'd have a bunch of useful data in Drummer that I could run scripts on and experiment with. I had a vision "sending" a single outline between the two tools as being fast and easy.

S3 would also be an interesting option. Could I create a heading in Drummer that expands to the content of an OPML file on S3? I know that used to be a thing back in the day.

GitHub would be great for certain kinds of outlines, but it's much more work for the stuff I'm imagining.

scripting commented 2 years ago

thanks @emk -- that's a perfectly fine use-case. there is an Import local file command in the File menu, that could help too.

emk commented 2 years ago

there is an Import local file command in the File menu, that could help too.

That's probably the way a reasonable person would do this, yes. ;-) Thank you!

I have occasionally been accused of trying to do things the hard way, often in the name of automation.