Rename from memento to ephemera
This commit is contained in:
parent
1858d883f6
commit
1b2dd7b541
1 changed files with 4 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
(ns memento
|
(ns ephemera
|
||||||
(:require [cheshire.core :as json]
|
(:require [cheshire.core :as json]
|
||||||
[org.httpkit.client :as http]
|
[org.httpkit.client :as http]
|
||||||
[clojure.string :as str])
|
[clojure.string :as str])
|
||||||
|
|
@ -8,9 +8,10 @@
|
||||||
(def acct (System/getenv "MASTODON_ACCOUNT"))
|
(def acct (System/getenv "MASTODON_ACCOUNT"))
|
||||||
(def auth-token (System/getenv "MASTODON_AUTH_TOKEN"))
|
(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? acct)) assert-msg)
|
||||||
(assert (not (empty? auth-token)) 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 #"@"))))
|
(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
|
@(sleep 2500) ; we need to wait, otherwise media_ids are still "attached" and can't be reused
|
||||||
(print "Recreating ")
|
(print "Recreating ")
|
||||||
(prn-res (mastodon-api
|
(prn-res (mastodon-api
|
||||||
(format "api/v1/statuses" #_(:id refiled))
|
(format "api/v1/statuses")
|
||||||
{:method :post
|
{:method :post
|
||||||
:headers {"Content-Type" "application/json"}
|
:headers {"Content-Type" "application/json"}
|
||||||
:body (json/encode
|
:body (json/encode
|
||||||
Loading…
Add table
Add a link
Reference in a new issue