nextcloud / bookmarks

🔖 Bookmark app for Nextcloud
https://apps.nextcloud.com/apps/bookmarks
GNU Affero General Public License v3.0
1.01k stars 173 forks source link

ArchiveBox optional integration? #1466

Open saywebsolutions opened 3 years ago

saywebsolutions commented 3 years ago

Is there any interest in maybe supporting an https://github.com/ArchiveBox/ArchiveBox integration in some way? It's a good solution for keeping archived copies of links. Maybe new bookmark entries could be added to an archivebox instance if configured?

marcelklehr commented 3 years ago

A nice way to realize this integration would probably be nextcloud flow. The bookmarks app already exposes a trigger for when new bookmarks are added, which could be used to create an entry in ArchiveBox. The only thing left to do is programming that bit of code. While this is not a priority for me as a maintainer, I'd be happy to help guide anybody willing to take this on.

saywebsolutions commented 3 years ago

interesting; I'll look into flow, thank you for the info

do you envision this using the workflow script app to potentially run the 'add to archivebox' routine upon bookmark creation?

marcelklehr commented 3 years ago

That would be cool, but I think the workflow script app only accepts file events and cannot deal with the triggers that the bookmarks app sends. So far, I suspect that a new app would have to be built. Ideally such an app would allow sending arbitrary HTTP requests with parameters so different services can be used as the target.

saywebsolutions commented 3 years ago

Ok I am following; so basically a new flow app called roughly "make HTTP request" built similarly to the script app but instead able to make HTTP requests to various API endpoints configured by the user. And also able to handle bookmark events. Do you have any info or links about how to receive the bookmark event in a flow script?

marcelklehr commented 3 years ago

The basic building block of a flow sink/receiver is an Operation, see e.g. the workflow script implementation: https://github.com/nextcloud/workflow_script/blob/master/lib/Operation.php#L132

The bookmarks app triggers instances of GenericEntityEvent with this entity: https://github.com/nextcloud/bookmarks/blob/master/lib/Flow/Bookmark.php

sunjam commented 3 years ago

archivebox already supports RSS, so it should be possible to send it rss feed shares of bookmarks!