From 02447b8b1294133aa9980b0b44e5118a835d124c Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sat, 3 Sep 2022 13:30:49 +1000 Subject: [PATCH] add wallabag annotationn to message of the day --- src/dhyan/connections/wallabag.clj | 2 -- src/dhyan/main.clj | 13 ++++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/dhyan/connections/wallabag.clj b/src/dhyan/connections/wallabag.clj index d7fe65d..261b4fe 100644 --- a/src/dhyan/connections/wallabag.clj +++ b/src/dhyan/connections/wallabag.clj @@ -154,8 +154,6 @@ archived-entries) (map-useful-annotation-keys)))) -(get-archived-annotated-entries) - (comment (-> (make-request (build-link) (get @token :access_token)) (make-resp-to-entries)) diff --git a/src/dhyan/main.clj b/src/dhyan/main.clj index 4571ff8..7813ba8 100644 --- a/src/dhyan/main.clj +++ b/src/dhyan/main.clj @@ -1,5 +1,7 @@ (ns dhyan.main (:require [dhyan.connections.shaarli :as shaarli] + [dhyan.connections.wallabag :as wallabag] + [clojure.string :as string] [dhyan.connections.matrix :as matrix])) (defn -main @@ -11,7 +13,16 @@ album-of-the-day (->> filtered-shaarli-data (mapv #(select-keys % [:url :title])) rand-nth) - message (str "Album of the day is: " (get album-of-the-day :title) " available at: " (get album-of-the-day :url)) + shaarli-message (str "Album of the day is: " (get album-of-the-day :title) + " available at: " (get album-of-the-day :url)) + wallabag-data (wallabag/get-archived-annotated-entries) + wallabag-entry-of-the-day (rand-nth wallabag-data) + wallabag-annotation-of-the-day (rand-nth wallabag-entry-of-the-day) + wallabag-message (str "Annotation of the day: " wallabag-annotation-of-the-day + " from the article: " (get wallabag-entry-of-the-day :title) + " available at: " (get wallabag-entry-of-the-day :url) + " tagged as: " (string/join ", " (get wallabag-entry-of-the-day :tags))) + message (string/join "\n" [shaarli-message wallabag-message]) ;file-data (sh "ls" (System/getenv "folder")) ; remove anything in () [] {} ;filtered-file-data (filterv #(string/replace % #"(.*)" "") file-data)