1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-02 16:38:37 +00:00

Add Shiori integration

This commit is contained in:
Frédéric Guillot 2023-08-13 12:48:29 -07:00
parent 13d9d86acd
commit 28df0b119e
26 changed files with 312 additions and 13 deletions

View file

@ -15,6 +15,7 @@ import (
"miniflux.app/v2/internal/integration/pinboard"
"miniflux.app/v2/internal/integration/pocket"
"miniflux.app/v2/internal/integration/readwise"
"miniflux.app/v2/internal/integration/shiori"
"miniflux.app/v2/internal/integration/telegrambot"
"miniflux.app/v2/internal/integration/wallabag"
"miniflux.app/v2/internal/logger"
@ -137,6 +138,20 @@ func SendEntry(entry *model.Entry, integration *model.Integration) {
logger.Error("[Integration] UserID #%d: %v", integration.UserID, err)
}
}
if integration.ShioriEnabled {
logger.Debug("[Integration] Sending Entry #%d %q for User #%d to Shiori", entry.ID, entry.URL, integration.UserID)
client := shiori.NewClient(
integration.ShioriURL,
integration.ShioriUsername,
integration.ShioriPassword,
)
if err := client.AddBookmark(entry.URL, entry.Title); err != nil {
logger.Error("[Integration] Unable to send entry #%d to Shiori for user #%d: %v", entry.ID, integration.UserID, err)
}
}
}
// PushEntries pushes an entry array to third-party providers during feed refreshes.