Rename from memento to ephemera

This commit is contained in:
arne 2024-06-20 18:38:36 +02:00
commit 1b2dd7b541

View file

@ -1,4 +1,4 @@
(ns memento
(ns ephemera
(:require [cheshire.core :as json]
[org.httpkit.client :as http]
[clojure.string :as str])
@ -8,9 +8,10 @@
(def acct (System/getenv "MASTODON_ACCOUNT"))
(def auth-token (System/getenv "MASTODON_AUTH_TOKEN"))
(def assert-msg "Please set the MASTODON_ACCOUNT, MASTODON_AUTH_TOKEN and MEMENTO_ACCOUNT env vars.")
(def assert-msg "Please set the MASTODON_ACCOUNT, MASTODON_AUTH_TOKEN env vars.")
(assert (not (empty? acct)) assert-msg)
(assert (not (empty? auth-token)) assert-msg)
(assert (str/includes? acct "@") "Please include the instance url in MASTODON_ACCOUNT.")
(def instance-url (format "https://%s" (last (str/split acct #"@"))))
@ -63,7 +64,7 @@
@(sleep 2500) ; we need to wait, otherwise media_ids are still "attached" and can't be reused
(print "Recreating ")
(prn-res (mastodon-api
(format "api/v1/statuses" #_(:id refiled))
(format "api/v1/statuses")
{:method :post
:headers {"Content-Type" "application/json"}
:body (json/encode