ozdemir08 / youtube-video-summarizer

MIT License
32 stars 7 forks source link

Expose summarizer API to be able to be called directly from JS / other plugins #10

Open rshmhrj opened 8 months ago

rshmhrj commented 8 months ago

ref: https://forum.obsidian.md/t/inter-plugin-communication-expose-api-to-other-plugins/23618

Right now the only way to use this plugin is via the command palette.

It would be nice if we could expose the API so that we can call it from elsewhere.

E.g. I have a Templater snippet where I get youtube video information and at the end, I want to invoke the summarizer.

<%*
let url = await tp.system.clipboard();
var ys = app.plugins.plugins['youtube-summarizer'];
console.log("youtube-summarizer-plugin", ys)
const summary = ys.api.summarize(url)
%>
### Summary
<% summary %>

Aside from my example, this would open up more usage opportunities across other plugins.

Medullitus commented 6 months ago

Did you make it working? How?