From e391cbe3472721deb45904895a568ac4c5d69e37 Mon Sep 17 00:00:00 2001 From: Peter Tillemans Date: Thu, 6 Mar 2025 12:17:38 +0100 Subject: [PATCH] initial commit --- .gitmodules | 3 +++ README.md | 11 +++++++++++ guile-mastodon | 1 + hello.scm | 15 +++++++++++++++ manifest.scm | 9 +++++++++ 5 files changed, 39 insertions(+) create mode 100644 .gitmodules create mode 100644 README.md create mode 160000 guile-mastodon create mode 100644 hello.scm create mode 100644 manifest.scm diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f215989 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "guile-mastodon"] + path = guile-mastodon + url = git@codeberg.org:snamellit/Guile-Mastodon.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..f1efe03 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Mastodon Notifications + +Cuirass can send notification of new packages in channels via +mastodon. This could be a nice way to deploy packages on hosting +servers. + +## Resources + +- [Guile-Mastodon repo on + Codeberg](https://codeberg.org/tomenzgg/Guile-Mastodon) + diff --git a/guile-mastodon b/guile-mastodon new file mode 160000 index 0000000..dec7118 --- /dev/null +++ b/guile-mastodon @@ -0,0 +1 @@ +Subproject commit dec71189560e9cd40b5a421a8f0ae26f9996036f diff --git a/hello.scm b/hello.scm new file mode 100644 index 0000000..2e716ee --- /dev/null +++ b/hello.scm @@ -0,0 +1,15 @@ +(use-modules (elefan auth) + (json)) + +(let ((app (masto-app-instantiate "https://social.snamellit.com" #:website "https://social.snamellit.com" + #:id (getenv "MASTODON_ID") + #:secret (getenv "MASTODON_SECRET") + #:key (getenv "MASTODON_KEY"))) + + (username (getenv "MASTODON_USERNAME")) + (password (getenv "MASTODON_PASSWORD")) + ) + (format #t "connecting to ~a with username ~a and password ~a~%" "https://social.snamellit.com" username password) + (masto-app-set-token-via-user-cred! app username password) + (format #t "App token: ~a~%" (masto-app-token app)) + ) diff --git a/manifest.scm b/manifest.scm new file mode 100644 index 0000000..126cacd --- /dev/null +++ b/manifest.scm @@ -0,0 +1,9 @@ +;; What follows is a "manifest" equivalent to the command line you gave. +;; You can store it in a file that you may then pass to any 'guix' command +;; that accepts a '--manifest' (or '-m') option. + +(specifications->manifest + (list + "guile" + "guile-gnutls" + "guile-json"))