From d83cd92728f077de1fac7ebc6bb20fa23dff29a8 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Wed, 9 May 2018 16:35:57 +0200 Subject: [PATCH] Add Newsboat --- user/newsboat/.config/newsboat/config | 21 +++++++++++++++++++++ user/newsboat/.config/newsboat/urls | 4 ++++ user/newsboat/.local/bin/wallabag_add.sh | 20 ++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 user/newsboat/.config/newsboat/config create mode 100644 user/newsboat/.config/newsboat/urls create mode 100755 user/newsboat/.local/bin/wallabag_add.sh diff --git a/user/newsboat/.config/newsboat/config b/user/newsboat/.config/newsboat/config new file mode 100644 index 0000000..af23822 --- /dev/null +++ b/user/newsboat/.config/newsboat/config @@ -0,0 +1,21 @@ +bookmark-cmd "~/.local/bin/wallabag_add.sh" +bookmark-autopilot yes +bookmark-interactive yes + +browser "firefox %u" + +bind-key j down +bind-key k up +bind-key l open +bind-key h quit articlelist +bind-key n toggle-article-read articlelist +bind-key N mark-feed-read articlelist +bind-key N mark-feed-read feedlist +bind-key s save articlelist +bind-key s save article +bind-key h quit article +bind-key r reload-all feedlist +bind-key b bookmark article +bind-key b bookmark articlelist + + diff --git a/user/newsboat/.config/newsboat/urls b/user/newsboat/.config/newsboat/urls new file mode 100644 index 0000000..de71486 --- /dev/null +++ b/user/newsboat/.config/newsboat/urls @@ -0,0 +1,4 @@ +https://www.archlinux.org/feeds/news/ +https://linuxfr.org/news.atom +https://framablog.org/feed/ +http://erj.ersjournals.com/rss/current.xml diff --git a/user/newsboat/.local/bin/wallabag_add.sh b/user/newsboat/.local/bin/wallabag_add.sh new file mode 100755 index 0000000..a4a6fba --- /dev/null +++ b/user/newsboat/.local/bin/wallabag_add.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "error: no url provided in arg" + exit 1 +fi + +export `pass api/wallabag` + +TOKEN=$(http -b POST https://bag.jombi.fr/oauth/v2/token \ + grant_type=password \ + client_id=$CLIENT_ID \ + client_secret=$CLIENT_SECRET \ + username=$USERNAME \ + password=$PASSWORD | jq -r '.access_token') + +http --print=HBhb POST https://bag.jombi.fr/api/entries.xml \ + "Authorization:Bearer $TOKEN" \ + url=$1 > /dev/null 2>&1 +